add dev scafold and day 1 solution

This commit is contained in:
Vladan Popovic 2022-12-01 23:45:12 +01:00
parent 49e961c0fd
commit 739b24dfbe
15 changed files with 2631 additions and 0 deletions

2
lib/dune Normal file
View file

@ -0,0 +1,2 @@
(library
(name utils))

11
lib/utils.ml Normal file
View file

@ -0,0 +1,11 @@
let read_file name =
let ic = open_in name in
let try_read () =
try Some (input_line ic)
with End_of_file -> None in
let rec aux acc =
match try_read () with
| Some s -> aux (s::acc)
| None -> close_in ic; acc in
aux []