1
0
Fork 0

Day 19: Forgot to revert experimental changes.

This commit is contained in:
Jonathan Chan 2021-12-19 21:54:09 -08:00 committed by Jonathan Chan
parent 279d5a6ae7
commit 499da3826a
1 changed files with 8 additions and 14 deletions

View File

@ -26,11 +26,6 @@
(match-let ([(list x y z) change])
(+ (abs x) (abs y) (abs z))))
(define (deltas region)
(for*/set ([beacon1 region]
[beacon2 region])
(abs (magnitude (delta beacon1 beacon2)))))
(define rotations
(for*/fold ([rotations '()])
([dx '(1 -1)]
@ -51,7 +46,6 @@
(values region (map #{set-map region %} rotations))))
(define (combine region1 region2)
(and (>= (set-count (set-intersect (deltas region1) (deltas region2))) 66)
(for*/or ([beacon1 region1]
[beacon2 region2])
(define change (delta beacon1 beacon2))
@ -59,7 +53,7 @@
(set-map region2 #{shift % (delta beacon1 beacon2)}))
(and (>= (set-count (set-intersect region1 shifted-region2)) 12)
(cons (set-union region1 shifted-region2)
change)))))
change))))
(define-values (part1 part2)
(time