summary refs log tree commit diff
path: root/src/Main.idr
blob: b3b48e6e7eebfd863941cb59f5ba7b894690162b (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
25
26
module Main

import Day1
import Day2
import Day3
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]
  3 => unlines [Day3.sol1 inp, Day3.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 ()