Tidy up 2024 day 11 code.
This commit is contained in:
@@ -6,6 +6,11 @@ let distance1 a b = abs (a - b)
|
||||
let strings_of_file fname =
|
||||
In_channel.with_open_text fname In_channel.input_lines
|
||||
|
||||
let string_of_file fname =
|
||||
match In_channel.with_open_text fname In_channel.input_line with
|
||||
| Some x -> x
|
||||
| None -> failwith "Aoc.string_of_file"
|
||||
|
||||
let main prep parts =
|
||||
try
|
||||
match Sys.argv with
|
||||
|
@@ -9,6 +9,9 @@ val strings_of_file : string -> string list
|
||||
(** [strings_from_file fname] returns a list of strings from the file [fname].
|
||||
Each string represents a line from the file. *)
|
||||
|
||||
val string_of_file : string -> string
|
||||
(** [string_of_file fname] returns the first line in [fname]. *)
|
||||
|
||||
val log10i : int -> int
|
||||
(** [log10i n] returns the floor of [(log10 (float_of_int n))]. [n] must be
|
||||
positive. *)
|
||||
|
Reference in New Issue
Block a user