mirror of
https://codeberg.org/JasterV/aoc2024-haskell.git
synced 2026-04-26 18:10:05 +00:00
wip: day2
This commit is contained in:
parent
a36b2e1ce5
commit
566a92499a
2 changed files with 19 additions and 0 deletions
|
|
@ -26,6 +26,7 @@ source-repository head
|
||||||
library
|
library
|
||||||
exposed-modules:
|
exposed-modules:
|
||||||
Day1
|
Day1
|
||||||
|
Day2
|
||||||
other-modules:
|
other-modules:
|
||||||
Paths_aoc2024
|
Paths_aoc2024
|
||||||
autogen-modules:
|
autogen-modules:
|
||||||
|
|
|
||||||
18
src/Day2.hs
Normal file
18
src/Day2.hs
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
module Day2 (partOne, partTwo) where
|
||||||
|
|
||||||
|
data Error = ParseError String
|
||||||
|
deriving (Show)
|
||||||
|
|
||||||
|
partOne :: String -> Either Error Int
|
||||||
|
partOne contents = calculateScore <$> parseInput contents
|
||||||
|
where
|
||||||
|
calculateScore _ = 0
|
||||||
|
|
||||||
|
partTwo :: String -> Either Error Int
|
||||||
|
partTwo contents = calculateScore <$> parseInput contents
|
||||||
|
where
|
||||||
|
calculateScore _ = 0
|
||||||
|
|
||||||
|
parseInput :: String -> Either Error [Int]
|
||||||
|
parseInput _ = Right []
|
||||||
|
|
||||||
Loading…
Reference in a new issue