summaryrefslogtreecommitdiff
path: root/02/main.scm
blob: 746fa0157ddf3fa2e0f7e4676219cb09af8991cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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))