aboutsummaryrefslogtreecommitdiff
path: root/2022
diff options
context:
space:
mode:
authorHunky Jimpjorps <thechairman@thechairman.info>2022-12-13 08:30:28 -0500
committerHunky Jimpjorps <thechairman@thechairman.info>2022-12-13 08:30:28 -0500
commit20853fecb52d1523be75bf10c7058e62796afec9 (patch)
tree0d2ef339c1a7c8ff573e3f435146a73dfaa52d65 /2022
parentfd3d1f61531f5c48125b822ab3bd2cdc65fc9254 (diff)
downloadgleam_aoc-20853fecb52d1523be75bf10c7058e62796afec9.tar.gz
gleam_aoc-20853fecb52d1523be75bf10c7058e62796afec9.zip
day 13 improvements with readtable
Diffstat (limited to '2022')
-rw-r--r--2022/day-13/day-13.rkt9
1 files changed, 3 insertions, 6 deletions
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)