@@ -39,8 +39,8 @@ object Day04:
3939 ....
4040 ....
4141 */
42- def topLeftPositions (w : Word )(p : Pos ): List [Pos ] =
43- List .range(start = p .col, end = p .col + w.length).map(col => Pos (p .row, col))
42+ def topLeftPositions (w : Word )(from : Pos ): List [Pos ] =
43+ List .range(start = from .col, end = from .col + w.length).map(col => Pos (from .row, col))
4444
4545 def wordCheckTopLeft (w : Word , store : StoreGrid ): WordCheckResult = wordCheck(topLeftPositions, w, store)
4646
@@ -50,8 +50,8 @@ object Day04:
5050 .M..
5151 X...
5252 */
53- def ascDiagonalPositions (w : Word )(p : Pos ): List [Pos ] =
54- List .range(start = 0 , end = w.length).reverse.map(i => Pos (row = i + p .row, col = w.length - i - 1 + p .col))
53+ def ascDiagonalPositions (w : Word )(from : Pos ): List [Pos ] =
54+ List .range(start = 0 , end = w.length).reverse.map(i => Pos (row = i + from .row, col = w.length - i - 1 + from .col))
5555
5656 def wordCheckAscDiagonal (w : Word , store : StoreGrid ): WordCheckResult = wordCheck(ascDiagonalPositions, w, store)
5757
@@ -61,8 +61,8 @@ object Day04:
6161 ..A.
6262 ...S
6363 */
64- def descDiagonalPositions (w : Word )(p : Pos ): List [Pos ] =
65- List .range(start = 0 , end = w.length).map(i => Pos (row = i + p .row, col = i + p .col))
64+ def descDiagonalPositions (w : Word )(from : Pos ): List [Pos ] =
65+ List .range(start = 0 , end = w.length).map(i => Pos (row = i + from .row, col = i + from .col))
6666
6767 def wordCheckDescDiagonal (w : Word , store : StoreGrid ): WordCheckResult = wordCheck(descDiagonalPositions, w, store)
6868
0 commit comments