~filiplajszczak/advent-of-code-2022

8675bc6e7aae7b8450714dd9c16548ffa5cb3765 — Filip Lajszczak 1 year, 8 months ago 9ff74cf
Beautification
2 files changed, 3 insertions(+), 2 deletions(-)

M advent01.scm
M advent04.scm
M advent01.scm => advent01.scm +1 -1
@@ 20,7 20,7 @@
   (string->paragraphs (string-trim-both (read-text filename)))))

(define (string->paragraphs str)
  (let ((paragraph-break (string-contains str "\n\n")))
  (let ([paragraph-break (string-contains str "\n\n")])
    (if paragraph-break
        (cons
         (string-take str paragraph-break)

M advent04.scm => advent04.scm +2 -1
@@ 8,7 8,8 @@
             ((f) #:select (read-lines)))

(define (parse-line line)
  (map (λ (range) (map string->number (string-split range #\-)))(string-split line #\,)))
  (map (λ (range) (map string->number (string-split range #\-)))
       (string-split line #\,)))

(define (contains? line)
  (let ([selections (parse-line line)])