- text <- readFile "data/advent01.txt"
- let instructions = successfulParse $ parseIline text
- part1 instructions
- part2 instructions
-
-part1 :: [Int] -> IO ()
-part1 instructions = do
- print $ sum instructions
-
-part2 :: [Int] -> IO ()
-part2 instructions = do
- print $ length $ takeWhile (>= 0) $ scanl (+) 0 instructions
-
-
-
--- instructionFile = instructionLine `endBy` newline
-instructionLine = many (up <|> down)