mirror of
https://github.com/mx42/adventofcode.git
synced 2026-01-14 05:49:52 +01:00
Enhanced the entry-point a bit
This commit is contained in:
@@ -1,9 +1,6 @@
|
|||||||
module Main where
|
module Main where
|
||||||
|
|
||||||
-- import Day1
|
import DayPicker
|
||||||
import Day2
|
|
||||||
|
|
||||||
-- TODO Day selection via args?
|
|
||||||
|
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
main = day2
|
main = dayPicker
|
||||||
|
|||||||
20
y2019/src/DayPicker.hs
Normal file
20
y2019/src/DayPicker.hs
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
module DayPicker
|
||||||
|
( dayPicker
|
||||||
|
)
|
||||||
|
where
|
||||||
|
|
||||||
|
import System.Environment
|
||||||
|
|
||||||
|
import Day1
|
||||||
|
import Day2
|
||||||
|
|
||||||
|
load :: [String] -> IO ()
|
||||||
|
load [] = putStrLn "Usage: script [day]"
|
||||||
|
load ("1":_) = day1
|
||||||
|
load ("2":_) = day2
|
||||||
|
load _ = putStrLn "Unavailable date"
|
||||||
|
|
||||||
|
dayPicker :: IO ()
|
||||||
|
dayPicker = do
|
||||||
|
args <- getArgs
|
||||||
|
load args
|
||||||
Reference in New Issue
Block a user