The Game of Life

The Game of Life will be available as an applet shortly...

This program is a replica of John Conway's Game of Life which demonstrates how a seemingly simple set of rules can give rise to some quite complex outcomes.

In the game of life, there are a series of 'living organisms' on a grid and each turn that organism may either survive or die.

Purpose

This program carries out the rules related to John Conway's Game of Life on a grid of 'organisms' represented by check boxes.


The Program

This program is written in Java 2 (using the Eclipse Platform IDE). There are two versions; a Java application and an applet which can be run through the web page.

A two dimensional Boolean array is used to hold the state of each cell (whether an 'organism' currently inhabits it). The starting position of organisms may be set by checking/unchecking the boxes before clicking start; these selections are committed to the array. Then when the game is started, the program iterates through each element of the array (through each dimension). On each element, a function is used to count the number of organisms surrounding it. This is achieved by incrementing and decrementing x and y co-ordinates to check each member of a 3x3 square, except the central one (the square being checked). Once the number of neighbours has been counted, the rules are used to determine what should happen to the organism.

A Timer object is used to execute the function at regular intervals (specified by the user) so that the user may see the situation developing.


Screenshots

Screenshots are available via links below. They will open in external windows. The screenshots are in PNG format (which any sensible browser should be able to open). Please note that all screenshots are ©Copyright 2006 D Wilkins unless otherwise stated.

The screenshots show the Java Application version of the program.


Download

The Game of Life will be available for download shortly...


Source Code

The source code for this program is available under the GNU General Public Licence (GPL). You are free to use, resdistribute and modify the program and its source code. References to the original author (i.e. me) are required on any distributed altered versions of this work and please make it clear that you have altered the program when redistributing so it is clear it is not entirely my work.

The source code for the Game of Life will be available shortly...


© Design and content copyright 2005-2007 D Wilkins.