Game of Life by Processing | Jason Zhu’s Personal Website
Game of Life by Processing
Game of life is a celluar automaton devised by mathematician John Horton Conway in 1970.
By applying static rules on certain initial state, the game will evolve itself and produce dynamic yet complicated patterns.
This is a “glider factory” in Game of Life.
This is a interesting pattern you can created in Game of Life.
Rule for Game of Life
Still, its rule is quite simple. As the game is played on a grid of square cells, it follows such rules:
Any live cell with fewer than two live neighbours dies, as if by underpopulation.
Any live cell with two or three live neighbours lives on to the next generation.
Any live cell with more than three live neighbours dies, as if by overpopulation.
Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.
The machine is turing complete and has much more potential that it seems to be.
I initialily saw related content on youtube and was greatly astonished by it.
Thus, I decided to use Processing to create my own version of the game.
Processing Code
I use java IDE instead of the Processing terminal for this code. Still, this can be transfromed to processing terminal by deleting the PApplet part:
And here is effect of my first version code, and you can also get the code on my github repo “Processing Tutorial”.
The rpogram enable user to input initial value by using left and right mouse button, while left click is to color it balck and right click is to make it white. Then, by pressing “Space” key you can start and stop the game process. When in the drawing mode, you can alter cells as you like and then press space key to keep on, and vice versa.