From ecd5ff63edc2467851d9bcd4b818afc3e1733557 Mon Sep 17 00:00:00 2001 From: Araozu Date: Sat, 2 Dec 2023 19:35:25 -0500 Subject: [PATCH] Day 1 part 1, fixed --- main.rkt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/main.rkt b/main.rkt index b93463f..16418dd 100644 --- a/main.rkt +++ b/main.rkt @@ -64,16 +64,18 @@ (string->number (string first-char last-char)))) +; Read file +(define file-contents + (port->string (open-input-file "input-01.txt") #:close? #t)) +; Split file into list of strings +(define input (string-split file-contents "\n")) + +; process (define char-list (map string->list input)) (define result (foldl + 0 (map list->digits char-list))) -(define file-contents - (port->string (open-input-file "input-01.txt") #:close? #t)) - - - -; (print result) +(print result)