X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;f=advent17%2FMain.hs;h=57794a95591b8c564b3d7e716fbe29c89ad1ef4b;hb=ba1fb8a459ef5514a246e66557fab4507824918e;hp=7c2b4d38a94e14a942a79cd60b8194392733d374;hpb=a30d9fbe80fb9f6080dcc360c82ae8a1dd054d1e;p=advent-of-code-22.git diff --git a/advent17/Main.hs b/advent17/Main.hs index 7c2b4d3..57794a9 100644 --- a/advent17/Main.hs +++ b/advent17/Main.hs @@ -42,10 +42,9 @@ main = print $ part2 oneJetCycle part1, part2 :: [Position] -> Int -part1 oneJetCycle = rocksHeight final -- fromMaybe -1 $ maximumOf (folded . _y) (final ^. chamber) - where final = simulate mkRocks (cycle oneJetCycle) 2022 +part1 oneJetCycle = rocksHeight $ simulate mkRocks (cycle oneJetCycle) 2022 -part2 oneJetCycle = calculatedHeight -- (cycleStartState, cycleRepeatState) +part2 oneJetCycle = calculatedHeight where initState = SimulationState { _chamber = S.empty , _jets = (cycle oneJetCycle)