Module mbryant_aoc2021::day25
source · [−]Expand description
Another slight twist on Conway’s game of life.
Enums
Cucumbers either have a direction or don’t exist.
Constants
Functions
A naive parsing approach.
Run the migration code east then south, until no cucumbers were moved. While it may seem like we can repeatedly modify the initial grid, this runs into trouble when cucumbers wrap around, so it’s easiest to modify a copy during each iteration.
There is no second part!
Type Definitions
Represent the set of cucumbers in a fixed 2D array, since we want the compiler to optimize copying and overwriting grids.