aboutsummaryrefslogtreecommitdiff
path: root/2015/day-06/day-06.rkt
diff options
context:
space:
mode:
authorHunky Jimpjorps <thechairman@thechairman.info>2022-11-26 01:43:33 -0500
committerHunky Jimpjorps <thechairman@thechairman.info>2022-11-26 01:43:33 -0500
commitfeccf3f6f0a806b3317d1f399e3e8b42945c4f09 (patch)
treebf15ce045d1106c1b7f7de30c27540f40d0bf947 /2015/day-06/day-06.rkt
parent8b624fe7d2751337b1f16830cc9c041df73e99e7 (diff)
downloadgleam_aoc-feccf3f6f0a806b3317d1f399e3e8b42945c4f09.tar.gz
gleam_aoc-feccf3f6f0a806b3317d1f399e3e8b42945c4f09.zip
using raco fmt, replacing missing dependency
Diffstat (limited to '2015/day-06/day-06.rkt')
-rw-r--r--2015/day-06/day-06.rkt9
1 files changed, 4 insertions, 5 deletions
diff --git a/2015/day-06/day-06.rkt b/2015/day-06/day-06.rkt
index 2cafa4e..d2eed08 100644
--- a/2015/day-06/day-06.rkt
+++ b/2015/day-06/day-06.rkt
@@ -10,7 +10,8 @@
(define instructions
(for/list ([l (in-lines (open-day 6 2015))])
(~>> l
- (regexp-match #px"(turn on|toggle|turn off) (\\d{1,3}),(\\d{1,3}) through (\\d{1,3}),(\\d{1,3})")
+ (regexp-match
+ #px"(turn on|toggle|turn off) (\\d{1,3}),(\\d{1,3}) through (\\d{1,3}),(\\d{1,3})")
rest
make-instruction)))
@@ -30,8 +31,7 @@
(for ([y (inclusive-range (instruction-y1 inst) (instruction-y2 inst))])
(vector2d-modify! light-grid x y (using inst)))))
-(define light-grid
- (make-vector (* 1000 1000) #false))
+(define light-grid (make-vector (* 1000 1000) #false))
(for ([i (in-list instructions)])
(modify-light-grid i light-grid todo))
(vector-count identity light-grid)
@@ -43,8 +43,7 @@
['|turn off| (λ (x) (max 0 (sub1 x)))]
['|toggle| (curry + 2)]))
-(define dimmable-grid
- (make-vector (* 1000 1000) 0))
+(define dimmable-grid (make-vector (* 1000 1000) 0))
(for ([i (in-list instructions)])
(modify-light-grid i dimmable-grid todo-dimmer))
(apply + (vector->list dimmable-grid))