This is a project I worked on during winter break 2004. It includes two "main" classes, a GameBoard class that is suitable for running Life or other cellular automata, and a GameOfLife class that extends GameBoard to include the rules of Conway's Game of Life. The other classes are examples utilizing GameBoard and GameOfLife to create the applet below.
What is Life? Click here... Much better applets than mine exist... Here's a Google search that should turn up a few. (As you can see, there is a lot of info on Life out there.) But I wrote this one myself to practice my programming skills. This is the most complex Java project I have worked on to date. It grew out of a single-class applet I wrote for an intermediate Java programming course at the University of Pittsburgh. It includes examples of arrays, threads, GUI elements, event handlers, and javadoc. I don't think anyone owns the game concept, and I'm releasing my version to the public domain, so feel free to use/modify my code any way you like.
OK enough technobabble. On with the game! Instructions:
Enter the size of the board (rows and columns of cells) and cell size (in pixels) below. Or just keep the default values. (Note, it won't work right if the game board is too big for your screen; the defaults should fit on most computer screens.)
Click on Start to bring up the game setup board where you can place your initial Life forms. Click on the black screen to turn individual cells off and on. (Hint: big clumps of dots are more interesting than scattered individuals.)
When you're done creating your first life forms, click the "Life" button to watch them grow and evolve (or die out!)
My "main" code:
javadoc for these classes
send mail to cms78 at pitt dot edu