My take on core Conway's Game of Life implementation in different languages. This code may not be optimal or even correct.
- Live cell with fewer thatn two neighbours dies from starvation
- Live cell with two or three neighbours survives
- Live cell with more than three neighbours dies from overpopulation
- Dead cell with three neighbours becomes live (reproduction)
Cell | State | Neighbours | Next State | Rule |
---|---|---|---|---|
1 | Dead | 2 | Dead | 4 |
2 | Dead | 3 | Live | 4 |
3 | Live | 1 | Dead | 1 |
4 | Live | 2 | Live | 2 |
5 | Live | 3 | Live | 2 |
6 | Dead | 3 | Live | 4 |
7 | Dead | 3 | Live | 4 |
8 | Live | 2 | Live | 2 |
9 | Dead | 2 | Dead | 4 |