Game of Life
29 Aug 2021Javascript
Another project inspired by Robert Heaton’s series of Programming Projects For Advanced Beginners.
The code is written in JavaScript and uses Node Canvas for image generation and GraphicsMagick for GIF generation. The Git repository for this project can be found here.
Conway’s Game of Life follows four simple rules:
-
Any live cell with 0 or 1 live neighbors becomes dead, because of underpopulation
-
Any live cell with 2 or 3 live neighbors stays alive, because its neighborhood is just right
-
Any live cell with more than 3 live neighbors becomes dead, because of overpopulation
-
Any dead cell with exactly 3 live neighbors becomes alive, by reproduction
An example of the Game of Life: