aboutsummaryrefslogtreecommitdiff
path: root/aoc2023-other/day-19
diff options
context:
space:
mode:
authorHunky Jimpjorps <thechairman@thechairman.info>2023-12-19 11:11:19 -0500
committerHunky Jimpjorps <thechairman@thechairman.info>2023-12-19 11:11:19 -0500
commitdcf361d68625c22bbaea26bb5108d5114af9587e (patch)
tree9a3cfaab0daaef372e205b2f73bd462a1bff48f5 /aoc2023-other/day-19
parentc5b16447516dc75e07bc3154f1614e791c786715 (diff)
downloadgleam_aoc-dcf361d68625c22bbaea26bb5108d5114af9587e.tar.gz
gleam_aoc-dcf361d68625c22bbaea26bb5108d5114af9587e.zip
day 19 racket complete
Diffstat (limited to 'aoc2023-other/day-19')
-rw-r--r--aoc2023-other/day-19/day-19.rkt9
1 files changed, 5 insertions, 4 deletions
diff --git a/aoc2023-other/day-19/day-19.rkt b/aoc2023-other/day-19/day-19.rkt
index bd073ca..9d9ad71 100644
--- a/aoc2023-other/day-19/day-19.rkt
+++ b/aoc2023-other/day-19/day-19.rkt
@@ -110,19 +110,19 @@
(split-range pr
rating
(interval i-min (sub1 threshold))
- (interval threshold i-max)
action
+ (interval threshold i-max)
tail)]
[(list* (rule rating (== >) threshold action) tail)
(match-define (interval i-min i-max) (rating pr))
(split-range pr
rating
(interval (add1 threshold) i-max)
- (interval i-min threshold)
action
+ (interval i-min threshold)
tail)]))
-(define (split-range pr rating keep pass action rules)
+(define (split-range pr rating keep action pass rules)
(+ (evaluate-rules-on-range (part-update-range pr rating keep)
(list (just action)))
(evaluate-rules-on-range (part-update-range pr rating pass)
@@ -130,4 +130,5 @@
(define start-interval (interval 1 4000))
-(evaluate-workflow-on-range (part start-interval start-interval start-interval start-interval))
+(evaluate-workflow-on-range
+ (part start-interval start-interval start-interval start-interval))