From 1fbb07c54523c7a576bfff1cb689e155dd55f15a Mon Sep 17 00:00:00 2001 From: Prefetch Date: Sat, 2 Mar 2024 19:36:12 +0100 Subject: Add first five days --- 02/main.scm | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 02/main.scm (limited to '02/main.scm') diff --git a/02/main.scm b/02/main.scm new file mode 100644 index 0000000..746fa01 --- /dev/null +++ b/02/main.scm @@ -0,0 +1,20 @@ +(import (chezscheme)) + +; Where the magic happens +(import (lib)) + +; Read my personal puzzle input +(define input + (call-with-input-file "input.txt" + (lambda (port) + (let loop ((line (get-line port)) + (result '())) + (if (eof-object? line) + (reverse result) + (loop (get-line port) (cons line result))))))) + +; Part 1 gives 44216 for me +(printf "Part 1 solution: ~a\n" (solve-part1 input)) + +; Part 2 gives 320 for me +(printf "Part 2 solution: ~a\n" (solve-part2 input)) -- cgit v1.2.3