1
0
Fork 0
advent-of-code/2022/app/Main.hs
2022-12-02 07:42:52 -05:00

21 lines
499 B
Haskell

{-# LANGUAGE OverloadedStrings #-}
module Main (main) where
import System.Environment (getArgs)
import qualified Aoc.Day1
import qualified Aoc.Day2
main :: IO ()
main = do
(dayS:partS:_) <- getArgs
let day = read dayS :: Integer
let part = read partS :: Integer
contents <- readFile ("input/" ++ (show day) ++ ".txt")
let f = case day of 1 -> Aoc.Day1.solve
2 -> Aoc.Day2.solve
_ -> error "unknown day"
putStrLn $ show $ f part contents