summary refs log tree commit diff
path: root/src/Main.idr
diff options
context:
space:
mode:
Diffstat (limited to 'src/Main.idr')
-rw-r--r--src/Main.idr22
1 files changed, 22 insertions, 0 deletions
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 <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 ()