From 20853fecb52d1523be75bf10c7058e62796afec9 Mon Sep 17 00:00:00 2001 From: Hunky Jimpjorps Date: Tue, 13 Dec 2022 08:30:28 -0500 Subject: day 13 improvements with readtable --- 2022/day-13/day-13.rkt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to '2022') diff --git a/2022/day-13/day-13.rkt b/2022/day-13/day-13.rkt index fbba69a..d4e3185 100644 --- a/2022/day-13/day-13.rkt +++ b/2022/day-13/day-13.rkt @@ -1,13 +1,10 @@ #lang racket -(require advent-of-code - threading) +(require advent-of-code) (define raw-packets - (~> (fetch-aoc-input (find-session) 2022 13 #:cache #true) - (string-replace _ "," " ") - (string-split "\n" #:repeat? #true) - (map (λ (str) (apply append (port->list read (open-input-string str)))) _))) + (parameterize ([current-readtable (make-readtable #f #\, #\space #f)]) + (port->list read (open-aoc-input (find-session) 2022 13 #:cache #true)))) (define (compare xs ys) (match* (xs ys) -- cgit v1.2.3