Conway's Game of Life is a "zero player game" consisting of a 2D grid of cells, which can be on or off ('alive' or 'dead'). The entire grid transitions from one state to another according to the following rules:
- For each cell, count how many of its eight neighbors are alive.
- If a live cell has fewer than two live neighbors, it dies as if from underpopulation.
- If a live cell has more than three live neighbors, it dies as if from overpopulation.
- If a dead cell has exactly three live neighbors, it becomes alive as if from reproduction.
- Otherwise, cells remain in their current state.
For example, if you start with a pattern like: