This commit is contained in:
Rhiannon Morris 2020-12-02 09:26:55 +01:00
commit 29d8387656
6 changed files with 21 additions and 0 deletions

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
_build
.merlin

6
aoc2020.ml Normal file
View file

@ -0,0 +1,6 @@
let days = [|Day1.main|]
let _ =
match Array.to_list Sys.argv with
| _exename :: day :: args -> days.(int_of_string day - 1) args
| _ -> Usage.exit "[day_num] args..."

6
day1.ml Normal file
View file

@ -0,0 +1,6 @@
let main2 _input =
print_endline "boop"
let main = function
| [input] -> main2 input
| _ -> failwith "usage: $0 1 infile"

2
dune Normal file
View file

@ -0,0 +1,2 @@
(executable
(name aoc2020))

1
dune-project Normal file
View file

@ -0,0 +1 @@
(lang dune 2.7)

4
usage.ml Normal file
View file

@ -0,0 +1,4 @@
let exit args =
let err = Format.sprintf "usage: %s %s" Sys.argv.(0) args in
print_endline err;
exit 1