mirror of
https://codeberg.org/JasterV/aoc2024-haskell.git
synced 2026-04-27 02:15:43 +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
|
||||
exposed-modules:
|
||||
Day1
|
||||
Day2
|
||||
other-modules:
|
||||
Paths_aoc2024
|
||||
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…
Add table
Add a link
Reference in a new issue