day 11a complete

missing bool value meant the flash updates stopped early
This commit is contained in:
Luke Else 2021-12-12 00:07:56 +00:00
parent 37174b18db
commit 79461b82c2

View File

@ -38,10 +38,11 @@ func main() {
for coord, energy := range octopuses {
if energy > 9 && !flashers[coord] {
complete = false
flashers[coord] = true
answer++
for _, neighbor := range coord.Neighbours(width, height, true) {
octopuses[neighbor]++
for _, neighbour := range coord.Neighbours(width, height, true) {
octopuses[neighbour]++
}
}
}