Fix indentation
This commit is contained in:
parent
9d6a92a04d
commit
9aaa19a1a5
@ -75,11 +75,11 @@ corruptMemory :: A.Array Coords Char -> [Coords] -> A.Array Coords Char
|
|||||||
corruptMemory = foldl (\a b -> a A.// [(b, '#')])
|
corruptMemory = foldl (\a b -> a A.// [(b, '#')])
|
||||||
|
|
||||||
findFirstBlocker :: A.Array Coords Char -> [Coords] -> Coords -> Coords -> Coords
|
findFirstBlocker :: A.Array Coords Char -> [Coords] -> Coords -> Coords -> Coords
|
||||||
findFirstBlocker memory (c:cs) start end =
|
findFirstBlocker memory (c : cs) start end =
|
||||||
let memory' = corruptMemory memory [c]
|
let memory' = corruptMemory memory [c]
|
||||||
memoryGraph = Graph {edges = M.fromList [(k, adjacent memory' k (70, 70)) | k <- A.indices memory']}
|
memoryGraph = Graph {edges = M.fromList [(k, adjacent memory' k (70, 70)) | k <- A.indices memory']}
|
||||||
in if findShortestPath memoryGraph start end == Infinity
|
in if findShortestPath memoryGraph start end == Infinity
|
||||||
then c
|
then c
|
||||||
else findFirstBlocker memory' cs start end
|
else findFirstBlocker memory' cs start end
|
||||||
|
|
||||||
day18_2 :: IO ()
|
day18_2 :: IO ()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user