diff options
author | Hunky Jimpjorps <thechairman@thechairman.info> | 2022-11-26 01:43:33 -0500 |
---|---|---|
committer | Hunky Jimpjorps <thechairman@thechairman.info> | 2022-11-26 01:43:33 -0500 |
commit | feccf3f6f0a806b3317d1f399e3e8b42945c4f09 (patch) | |
tree | bf15ce045d1106c1b7f7de30c27540f40d0bf947 /2015/day-03/day-03.rkt | |
parent | 8b624fe7d2751337b1f16830cc9c041df73e99e7 (diff) | |
download | gleam_aoc-feccf3f6f0a806b3317d1f399e3e8b42945c4f09.tar.gz gleam_aoc-feccf3f6f0a806b3317d1f399e3e8b42945c4f09.zip |
using raco fmt, replacing missing dependency
Diffstat (limited to '2015/day-03/day-03.rkt')
-rw-r--r-- | 2015/day-03/day-03.rkt | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/2015/day-03/day-03.rkt b/2015/day-03/day-03.rkt index efa09ad..1d44955 100644 --- a/2015/day-03/day-03.rkt +++ b/2015/day-03/day-03.rkt @@ -2,7 +2,6 @@ (require "../../jj-aoc.rkt" threading (only-in algorithms chunks-of) - (only-in awesome-list transpose) racket/hash) (define directions @@ -11,10 +10,7 @@ (define (trace-santa dirs) (define visits (make-hash)) - (for/fold ([x 0] - [y 0] - #:result visits) - ([dir (in-list dirs)]) + (for/fold ([x 0] [y 0] #:result visits) ([dir (in-list dirs)]) (hash-set! visits `(,x ,y) #true) (match dir ['^ (values x (add1 y))] @@ -26,11 +22,7 @@ (~> directions trace-santa hash-values length) ;; part 2 -(~> directions - (chunks-of 2) - transpose - (map trace-santa _) - (match-define (list real robo) _)) +(~> directions (chunks-of 2) (apply map list _) (map trace-santa _) (match-define (list real robo) _)) (hash-union! real robo #:combine (λ _ #true)) -(~> real hash-values length)
\ No newline at end of file +(~> real hash-values length) |