Game4Life

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:

  1. An alive cell dies if there is less than 2 or more than 3 cells around.
  2. 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
panel.hcells=100
# Nº of vertical cells
panel.vcells=50
# Cell size in pixels
panel.cell=10

The duration in milliseconds for each step.

# Controls
# Delay time between steps in milliseconds
delay.millis=500

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.

Game4Life - Init

Game4Life – Init

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“.

Game 4 Life - Run

Game 4 Life – Run

Game 4 Life - Set up

Game 4 Life – Set up

The entire project (eclipse version and maven) can be downloaded from here. Enjoy it!