From 5ba0d95a80c06a39e65abc52200ee2fd7ee90bda Mon Sep 17 00:00:00 2001 From: Crazazy Date: Sun, 1 Dec 2024 14:15:18 +0100 Subject: made some AoC infrastructure --- src/Main.idr | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/Main.idr (limited to 'src/Main.idr') diff --git a/src/Main.idr b/src/Main.idr new file mode 100644 index 0000000..e2faf59 --- /dev/null +++ b/src/Main.idr @@ -0,0 +1,22 @@ +module Main + +import Day1 +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] + _ => "Not implemented yet!" + +main : IO () +main = do + args <- getArgs + digit <- maybe (die "Usage: aoc ") pure $ getAt 1 args + num <- maybe (die "Usage: aoc ") pure (parseInteger digit) + einp <- readFile ("./data/day" ++ (show num) ++ ".txt") + inp <- either (const $ die "Not implemented yet!") pure einp + putStrLn $ runDay num inp + pure () -- cgit 1.4.1-2-gfad0