blob: c90397f5f5b174ca689b95813a8fdf286dd0be9a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
module Main
import Day1
import Day2
import System
import System.File
import Data.Fin
import Data.String
runDay : Int -> String -> String
runDay n inp = case n of
1 => unlines [Day1.sol1 inp, Day1.sol2 inp]
2 => unlines [Day2.sol1 inp, Day2.sol2 inp]
_ => "Not implemented yet!"
main : IO ()
main = do
args <- getArgs
digit <- maybe (die "Usage: aoc <daynumber>") pure $ getAt 1 args
num <- maybe (die "Usage: aoc <daynumber>") pure (parseInteger digit)
einp <- readFile ("./data/day" ++ (show num) ++ ".txt")
inp <- either (const $ die "Not implemented yet!") pure einp
putStrLn $ runDay num inp
pure ()
|