diff options
author | Hunky Jimpjorps <thechairman@thechairman.info> | 2022-12-14 10:49:26 -0500 |
---|---|---|
committer | Hunky Jimpjorps <thechairman@thechairman.info> | 2022-12-14 10:49:26 -0500 |
commit | 9384f349e3fe5d422141bf64be05e7ae477c99f0 (patch) | |
tree | 72289bc40ac8e2428ffb36171e3b66dbfd3cd771 /2022 | |
parent | ef1c9034a0269156b0b0e99cd1ff14192c24e0ef (diff) | |
download | gleam_aoc-9384f349e3fe5d422141bf64be05e7ae477c99f0.tar.gz gleam_aoc-9384f349e3fe5d422141bf64be05e7ae477c99f0.zip |
day 13 tweaks
Diffstat (limited to '2022')
-rw-r--r-- | 2022/day-13/day-13.rkt | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/2022/day-13/day-13.rkt b/2022/day-13/day-13.rkt index d4e3185..39435e9 100644 --- a/2022/day-13/day-13.rkt +++ b/2022/day-13/day-13.rkt @@ -10,11 +10,11 @@ (match* (xs ys) [('() (list* _)) #true] [((list* _) '()) #false] - [((list* a x-rest) (list* a y-rest)) (compare x-rest y-rest)] + [((list* _same x-rest) (list* _same y-rest)) (compare x-rest y-rest)] [((list* (? integer? x) _) (list* (? integer? y) _)) (< x y)] [((list* (? list? xs*) _) (list* (? list? ys*) _)) (compare xs* ys*)] - [((list* (? list?) _) (list* (? integer? y) y-rest)) (compare xs (cons (list y) y-rest))] - [((list* (? integer? x) x-rest) (list* (? list?) _)) (compare (cons (list x) x-rest) ys)])) + [(xs (list* (? integer? y) y-rest)) (compare xs (cons (list y) y-rest))] + [((list* (? integer? x) x-rest) ys) (compare (cons (list x) x-rest) ys)])) ;; part 1 (for/sum ([i (in-naturals 1)] [packet (in-slice 2 raw-packets)] #:when (apply compare packet)) i) |