1
0
Fork 0
advent-of-code/2022/app/Main.hs

20 lines
431 B
Haskell
Raw Normal View History

2022-12-01 08:57:41 -05:00
{-# LANGUAGE OverloadedStrings #-}
2022-12-01 08:29:30 -05:00
module Main (main) where
2022-12-01 08:57:41 -05:00
2022-12-01 09:26:39 -05:00
import System.Environment (getArgs)
2022-12-01 10:07:52 -05:00
import qualified Aoc.Day1
2022-12-01 08:57:41 -05:00
2022-12-01 08:29:30 -05:00
main :: IO ()
main = do
2022-12-01 10:07:52 -05:00
(dayS:partS:_) <- getArgs
let day = read dayS :: Integer
let part = read partS :: Integer
contents <- readFile ("input/" ++ (show day) ++ ".txt")
2022-12-01 08:29:30 -05:00
2022-12-01 10:07:52 -05:00
let f = case day of 1 -> Aoc.Day1.solve
_ -> error "unknown day"
2022-12-01 09:26:39 -05:00
2022-12-01 10:07:52 -05:00
putStrLn $ show $ f part contents
2022-12-01 08:29:30 -05:00