refactoring (probably needed for previous days too, oops)
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
(define (step! matrix)
|
||||
(let [(flashes '())]
|
||||
; increase energy of all octopuses
|
||||
(visit-matrix!
|
||||
(update-matrix!
|
||||
matrix
|
||||
(lambda (x y energy)
|
||||
(when (= energy 9)
|
||||
@@ -35,7 +35,7 @@
|
||||
(flash! matrix (vec2i-x (car flash))
|
||||
(vec2i-y (car flash)))))))
|
||||
; drain all octopuses that flashed
|
||||
(visit-matrix!
|
||||
(update-matrix!
|
||||
matrix
|
||||
(lambda (x y energy)
|
||||
(if (< energy 10) energy 0)))
|
||||
|
||||
Reference in New Issue
Block a user