Game4Life is my personal representation of the famous Conway’s Game of Life cellular automaton. It shows a custom size grid where the user can set any initial configuration of alive or dead cells. When running, it follows the original basic rules, that is:
- An alive cell dies if there is less than 2 or more than 3 cells around.
- An empty (dead) cell comes to life if there are just 3 alive cells around.
The application is developed using JSE 8 and for all the graphical stuff I’ve used Processing. It includes simple user interface controls and detailed information.
Certain features can be configured before launching the program:
The grid size, given in number of horizontal and vertical cells and cell side. Each cell is a square:
# Main panel
# Nº of horizontal cells
# Nº of vertical cells
# Cell size in pixels
The duration in milliseconds for each step.
# Delay time between steps in milliseconds
Any initial configuration can be inserted on the grid. Originally the gris is empty (no cells are alive). In order to enter an alive cell, it is enough by clicking or dragging the mouse pointer on a cell.
To start the game, press on the “Start” button on the bottom part of the application. To pause it, press on “Stop“. To clean the grid and remove any alive cell, press on “Clean“.
The entire project (eclipse version and maven) can be downloaded from here. Enjoy it!