From 80af66af9527999e29343b14d3311f0a0b83c4f4 Mon Sep 17 00:00:00 2001 From: DJ O'Leary Date: Fri, 5 Dec 2025 01:57:00 +0100 Subject: feat(2025d4p1): create skeleton --- 2025/ocaml/lib/application/d04p01.ml | 1 + 2025/ocaml/lib/application/d04p01.mli | 4 ++++ 2025/ocaml/lib/presentation/cli.ml | 6 +++++- 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 2025/ocaml/lib/application/d04p01.ml create mode 100644 2025/ocaml/lib/application/d04p01.mli diff --git a/2025/ocaml/lib/application/d04p01.ml b/2025/ocaml/lib/application/d04p01.ml new file mode 100644 index 0000000..26319df --- /dev/null +++ b/2025/ocaml/lib/application/d04p01.ml @@ -0,0 +1 @@ +let solve _ () = failwith "not started" diff --git a/2025/ocaml/lib/application/d04p01.mli b/2025/ocaml/lib/application/d04p01.mli new file mode 100644 index 0000000..2fd4e44 --- /dev/null +++ b/2025/ocaml/lib/application/d04p01.mli @@ -0,0 +1,4 @@ +val solve : string -> unit -> int +(** [solve input ()] is the solution for the first part of the fourth day of advent of code 2025 for [input]. + The solution for an empty input is 0. + Requires: [input] to be a string. *) diff --git a/2025/ocaml/lib/presentation/cli.ml b/2025/ocaml/lib/presentation/cli.ml index 5863d21..1a8e7f7 100644 --- a/2025/ocaml/lib/presentation/cli.ml +++ b/2025/ocaml/lib/presentation/cli.ml @@ -3,7 +3,7 @@ let run_solver name solver filepath = let content = Infrastructure.File.read filepath in let answer = solver content () in - Logs.app (fun m -> m "%s=%d" name answer) + Logs.app (fun m -> m "[%s] ANSWER=%d" name answer) let run_day _ = function | 1 -> @@ -20,6 +20,10 @@ let run_day _ = function let filepath = "../_input/day_03.txt" in run_solver "D03P01" Application.D03p01.solve filepath ; 0 + | 4 -> + let filepath = "../_input/day_04.txt" in + run_solver "D04P01" Application.D04p01.solve filepath ; + 0 | _ -> failwith "day not implemented" -- cgit v1.2.3