diff options
-rw-r--r-- | day10/day10.hs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/day10/day10.hs b/day10/day10.hs index 5c970e5..8b063dd 100644 --- a/day10/day10.hs +++ b/day10/day10.hs @@ -69,12 +69,19 @@ score th = where untrail (Point c _ _) = c +rating :: [Trail] -> Int +rating = length + part1 :: Map -> Int part1 mp = sum $ map (score . (trails mp)) $ trailheads mp +part2 :: Map -> Int +part2 mp = + sum $ map (rating . (trails mp)) $ trailheads mp + main = do file <- readFile "day10.input" let mp = consume file putStrLn ("Part 1: " ++ (show $ part1 mp)) - --putStrLn ("Part 2: " ++ (show $ part2 mp)) + putStrLn ("Part 2: " ++ (show $ part2 mp)) |