From 3266661d4c6ed2e255f8e4d63ec7e5f58d4ddfe8 Mon Sep 17 00:00:00 2001 From: Brian Chu Date: Thu, 1 Dec 2022 21:54:55 -0800 Subject: handle values in command line parsing --- Program.fs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Program.fs') diff --git a/Program.fs b/Program.fs index f720b0c..e85d15f 100644 --- a/Program.fs +++ b/Program.fs @@ -1,5 +1,5 @@ open Solutions -exception NotImplementedYet of string +exception NotImplemented of string let args = System.Environment.GetCommandLineArgs() @@ -11,5 +11,6 @@ match (day, part) with | (1, 1) -> Day1.part1 () |> printf "%A\n" | (1, 2) -> Day1.part2 () |> printf "%A\n" | (2, 1) -> Day2.part1 () |> printf "%A\n" -| (2, 2) -> Day2.part2 () |> printfn "%A\n" -| _ -> raise (NotImplementedYet("not implemented yet")) \ No newline at end of file +| (2, 2) -> Day2.part2 () |> printf "%A\n" +| (x, y) when (1 <= x && x <= 25) && (y = 1 || y = 2) -> raise (NotImplemented("not implemented yet")) +| _ -> raise (NotImplemented("invalid values")) \ No newline at end of file -- cgit 1.4.1-2-gfad0