The Game of Life

Download HolubLife.jar, version 1.03, released 16 July, 2005.

If you have Java installed on your machine, you can "open" the file rather than saving it to the disk if all you want to do is run the program.

HolubLife.jar contains an implementation of John Conway's game of Life, as described in my book Holub on Patterns.

The .jar contains an executable version of the program, the source code presented in the book (with known bugs fixed), and javadoc documentation.

Execute the downloaded program with java -jar HolubLife.jar. You don't have to unpack the jar unless you want to look at the sources or documentation.

I've tested using both Java 1.4.2 and Java 5, the enclosed .class files are 1.4 files, so should run fine with either JVM. There are no known bugs in the current release, but if you should find one, please report it. I'll post a note to the newsletter if I discover any new bugs.

The book contains a very detailed description of this implementation.

–Allen Holub

Get the Life implementation from the book by following the directions at right.

John Conway's Game of Life is probably the most widely implemented application in the universe. Here are some links to follow to get more information:

I strongly recommend that you play with the game to get an understanding of how it works. To make things easy, the following buttons launch Hensel's applet, preloaded with a few of my favorite "seed" patterns. The main thing to keep in mind as you watch things work is that the behavior that you see is all "emergent." For example, the notion of a "glider" is not programmed into Life. All that is programmed is the behavior of an individual cell, which decides whether it will be alive or dead on the next clock tick based on the number of live neighbors on the current clock tick. These simple rules yield very complex and interesting behavior, however.

The notion of emergence is critical to OO thinking. You design (and build) around use-case scenarios, and you don't design for every possible scenario. Nonetheless, scenarios that you hadn't thought of are handled by the program. A good (layman's) introduction to emergence is Steve Johnson's Emergence: The Connected Lives of Ants, Brains, Cities, and Software (Scribner, 2002). As an interesting aside, Paul Rendell has constructed a Turing Machine in the Game of Life. Since a Turing machine can, in theory, model the behavior of any computer, you can infer from Rendell's work that Life can simulate the behavior of any computer program. That is, the behavior of all computer programs can be viewed as emergent behavior.