Skip to main content

Module day11

Module day11 

Source
Expand description

§Dumbo Octopus

This puzzle resembles the Day 9 flood fill a little. Since there are only 100 octopuses a fixed-size array is used to track current energy levels. Once every octopus has been bumped at the start of a turn, an energy level of zero means that the octopus has already flashed. Each time an octopus flashes it bumps its neighbors’ energy levels, which can propagate recursively through the entire grid.

The 10x10 grid is padded by 1 on either side with zeroes so that we can avoid boundary checks.

Functions§

bump_octopus 🔒
Increments an octopus’s energy. If it reaches 10, it flashes and is added to the queue.
parse
part1
part2
simulate 🔒

Type Aliases§

Input 🔒