Expand description

Another slight twist on Conway’s game of life.

Enums

Cucumbers either have a direction or don’t exist.

Constants

Height of the grid

Width of the grid

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.