Example code (in the form of katas) we created to discuss on the podcast.
Given a 2-dimensional grid, each position on the grid represents a cell. Each cell is either alive or dead and has eight neighbors (the surrounding grid positions).
At each transition (a tick or next generation), each cell follows these rules:
- A live cell will die if it has less than 2 living neighbors.
- A live cell will continue to live if it has 2 or 3 living neighbors.
- A live cell will die if it has more than 3 living neighbors.
- A dead cell will be brought to life if it has exactly 3 living neighbors.
Learn more on Wikipedia.