2024-07-30 01:11:49 +02:00
|
|
|
{-# LANGUAGE TypeApplications #-}
|
2023-10-09 20:44:52 +02:00
|
|
|
module Main where
|
|
|
|
|
|
|
|
import qualified Day01
|
2024-07-30 01:11:49 +02:00
|
|
|
import qualified Day02
|
2023-10-11 18:56:36 +02:00
|
|
|
import qualified Day03
|
2024-07-30 01:11:49 +02:00
|
|
|
import Text.Printf (printf)
|
2023-10-09 20:44:52 +02:00
|
|
|
|
|
|
|
readDay :: Int -> IO String
|
|
|
|
readDay n = readFile $ getPath n
|
2024-07-30 01:11:49 +02:00
|
|
|
where
|
|
|
|
getPath n = "../.inputs/" <> printf "%02d" n
|
2023-10-09 20:44:52 +02:00
|
|
|
|
|
|
|
main :: IO ()
|
|
|
|
main = do
|
2024-07-30 01:11:49 +02:00
|
|
|
content <- readDay 2
|
|
|
|
let parsed = Day02.parse content
|
|
|
|
print $ Day02.solveA parsed
|
|
|
|
print @Int $ Day02.solveB parsed
|