You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
509 B
23 lines
509 B
module Main where
|
|
import qualified Day1 as D1
|
|
import qualified Day2 as D2
|
|
|
|
solutions :: [(String -> String, String -> String)]
|
|
solutions = [(D1.part1, D1.part2),
|
|
(D2.part1, D2.part2)]
|
|
|
|
|
|
run :: Int -> Int -> IO ()
|
|
run day part = do
|
|
input <- readFile ("inputs/" ++ show day)
|
|
let select = if part == 1 then fst else snd
|
|
putStrLn $ select (solutions !! (day - 1)) input
|
|
pure ()
|
|
|
|
|
|
main :: IO ()
|
|
main = do
|
|
day <- getLine
|
|
problem <- getLine
|
|
run (read day :: Int) (read problem :: Int)
|
|
|