Day 9 - Part 1 refactor with state
This commit is contained in:
@@ -67,13 +67,13 @@ spec =
|
||||
let positions = parseMovements
|
||||
>>> concatMap normalizeMovement
|
||||
>>> recordPositions
|
||||
>>> fst
|
||||
>>> sort
|
||||
$ testInput
|
||||
length positions `shouldBe` 13
|
||||
positions `shouldBe` expectedPositions
|
||||
it "solves the riddle" $ do
|
||||
input <- readFile "ressources/day09-input"
|
||||
putStrLn "Day9"
|
||||
let movements = parseMovements input
|
||||
let positions = concatMap normalizeMovement >>> recordPositions >>> length $ movements
|
||||
let positions = concatMap normalizeMovement >>> recordPositions >>> fst >>> length $ movements
|
||||
positions `shouldBe` 5878
|
||||
|
||||
Reference in New Issue
Block a user