diff options
Diffstat (limited to 'day21/main.hs')
| -rw-r--r-- | day21/main.hs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/day21/main.hs b/day21/main.hs new file mode 100644 index 0000000..fa6926b --- /dev/null +++ b/day21/main.hs @@ -0,0 +1,20 @@ +module Main where + +import Debug.Trace (traceShow) +import Part1 +import Part2 +import Utils + +main :: IO () +main = do + contents <- getContents + let initialPositions@[p1Pos, p2Pos] = contents $> lines .> map (drop 28) .> map read :: [Int] + let initialState = makeState1 initialPositions [0, 0] 1 0 + print initialState + let (_, loserScore, dieRolledN) = simulate1 initialState 0 + print $ loserScore * dieRolledN + + let part2State = makeState2 (p1Pos, 0) (p2Pos, 0) + + -- this has a 50% chance of giving the right answer :D + print $ simulate2 0 part2State
\ No newline at end of file |
