AoC 2021 D25: Sea Cucumber
| Problem statement | Source code | Tags: Cellular automata
I thought this requires something clever, but simulating it straightforwardly is fast enough. For example, this is the code for moving the east-facing cucumbers:
Checking for stabilization is done with a tiny trick: JSON.stringify(mat) === JSON.stringify(newMat2).