summaryrefslogtreecommitdiff
path: root/2025/ocaml
diff options
context:
space:
mode:
authorDJ O'Leary <dijitol@proton.me>2025-12-05 01:57:00 +0100
committerDJ O'Leary <dijitol@proton.me>2025-12-05 01:57:00 +0100
commit80af66af9527999e29343b14d3311f0a0b83c4f4 (patch)
tree1f1e65994ca0179dec144e3bd6f74bf6589bfb5f /2025/ocaml
parent58d165a4156336473a9f8bbe0f55823d0b973fc2 (diff)
feat(2025d4p1): create skeleton
Diffstat (limited to '2025/ocaml')
-rw-r--r--2025/ocaml/lib/application/d04p01.ml1
-rw-r--r--2025/ocaml/lib/application/d04p01.mli4
-rw-r--r--2025/ocaml/lib/presentation/cli.ml6
3 files changed, 10 insertions, 1 deletions
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"