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.

[no button] Clicking this button brings up the applet without any patterns preinstalled. Click on a square to mark a cell as "alive." Click the "Go" to start the clock. Click the "Open" button to select from a large list of patterns.
[no button] Lightspeed looks like a firecracker exploding. It demonstrates how Life can simulate very natural, but chaotic, behavior.
[no button] This pattern shows you a few basic gliders, but it also demonstrates reflection (getting a glider to change direction, in this case by bouncing off another glider).
[no button] A "Gun" in life is a glider factory. A repeating pattern works in such a way that it generates a glider, which is ejected from the factory.
[no button] "Puf Train" is one of my favorite patterns. It starts out with a very simple seed, which moves off to the right creating a "smoke" trail behind it. There are more-complex trains, but this one nicely demonstrates a pattern that simulates a natural behavior.
[no button] The "Max" pattern was discovered only recently using computer analysis. It demonstrates growth. The original seed retains it's shape, but grows larger and larger. Eventually, it will occupy the entire "Universe."
[no button] A school of jellyfish swim across the screen.
[no button] Two large life forms move across the screen, creating and then activating glider-generating "guns."
[no button] A stable colony. Doesn't grow in size, but is very active within the boundaries of its world.