Day 9 - Part 1 refactor with state

This commit is contained in:
Jens Kadenbach
2022-12-09 17:56:20 +01:00
parent 9bd3d62eec
commit dc5a757eb6
2 changed files with 21 additions and 11 deletions

View File

@@ -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