Fix bounds check
This commit is contained in:
@@ -88,7 +88,7 @@ module Day10 =
|
||||
let mutable pointB =
|
||||
let pos = ofRowAndCol lineLength (startLine - 1) startCol
|
||||
|
||||
match s.[pos] with
|
||||
match if pos >= 0 then s.[pos] else 'n' with
|
||||
| '|'
|
||||
| '7'
|
||||
| 'F' -> pos
|
||||
@@ -96,7 +96,7 @@ module Day10 =
|
||||
|
||||
let pos = ofRowAndCol lineLength (startLine + 1) startCol
|
||||
|
||||
match s.[pos] with
|
||||
match if pos < s.Length then s.[pos] else 'n' with
|
||||
| '|'
|
||||
| 'L'
|
||||
| 'J' -> pos
|
||||
@@ -104,7 +104,7 @@ module Day10 =
|
||||
|
||||
let pos = ofRowAndCol lineLength startLine (startCol + 1)
|
||||
|
||||
match s.[pos] with
|
||||
match if pos < s.Length then s.[pos] else 'n' with
|
||||
| '-'
|
||||
| 'J'
|
||||
| '7' -> pos
|
||||
|
Reference in New Issue
Block a user