Home‎ > ‎Luc‎ > ‎Software Applications‎ > ‎

Game of Life

This application is a cellular automaton, and is best described here by Wikipedia --> link.

This application will simulate life by representing each by cells. The rules are as follows (taken from Wikipedia):

***************************************************************************************

The universe of the Game of Life is an infinite two-dimensional orthogonal grid of square cells, each of which is in one of two possible states, live or dead. Every cell interacts with its eight neighbours, which are the cells that are directly horizontally, vertically, or diagonally adjacent. At each step in time, the following transitions occur:

  1. Any live cell with fewer than two live neighbours dies, as if by loneliness.
  2. Any live cell with more than three live neighbours dies, as if by overcrowding.
  3. Any live cell with two or three live neighbours lives, unchanged, to the next generation.
  4. Any dead cell with exactly three live neighbours comes to life.

The initial pattern constitutes the 'seed' of the system. The first generation is created by applying the above rules simultaneously to every cell in the seed-- births and deaths happen simultaneously, and the discrete moment at which this happens is sometimes called a tick. (In other words, each generation is based entirely on the one before.) The rules continue to be applied repeatedly to create further generations.

****************************************************************************************

 A quarter of the project was getting it to work correctly, the rest was performance. Our game of life has no boundaries, and both directions extend out to infinity, essentially creating an infinite plane. The description of this project is affixed below in the attachments, and is quite a good read to understand how the program works. My partner Catalina and I worked very hard at obtaining excellent performance metrics on this project, and indeed it did pay off.

 

View below for a full source code and binaries. It is also possible to obtain a report below.

By downloading and extracting the zip file you can open applet.htm which will do a demonstration. I just can't run the applet on this webserver.
ċ
gameOfLife.zip
(219k)
lucgallant,
21 Oct 2008, 21:03
ĉ
lucgallant,
21 Oct 2008, 21:05
Comments