summaryrefslogtreecommitdiff
path: root/05/main.scm
diff options
context:
space:
mode:
authorPrefetch2024-03-02 19:36:12 +0100
committerPrefetch2024-03-02 19:36:12 +0100
commit1fbb07c54523c7a576bfff1cb689e155dd55f15a (patch)
tree7aa9f92a7d99ae9203b538803b7efefd846b67e0 /05/main.scm
parentaf589b238c1d51960d8af3b36041aca2bad7855b (diff)
Add first five days
Diffstat (limited to '05/main.scm')
-rw-r--r--05/main.scm20
1 files changed, 20 insertions, 0 deletions
diff --git a/05/main.scm b/05/main.scm
new file mode 100644
index 0000000..2ec4357
--- /dev/null
+++ b/05/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 342669 for me
+(printf "Part 1 solution: ~a\n" (solve-part1 input))
+
+; Part 2 gives 25136209 for me
+(printf "Part 2 solution: ~a\n" (solve-part2 input))