Live Animation Controls Big (Yes, this is the best naming scheme I could come up with)
Ok, so THIS is my finished simple version of Conway's Game of Life. Clicking on the Randomize button, obviously, randomizes the board. Below that is the probability field. Enter an integer from 0 to 100 here, and hit enter. This is the probability that at each generation stepping a new cell will be created randomly on the board. This version also implements a size adjustment, with numbered buttons. Neat things can be done here, at first it was a bug, but I decided to leave it and call it a feature. Go to size 3, then randomize. Then go to size 2, and clear, then size one and randomize. Then go back to size 3. This must all be done quickly though. Neat huh?
The game starts out with the rules that an empty cell is created if it
has 3 neighbors, and a full cell is allowed to live if it has 2 or 3 neighbors.
These can be changed using the Creates With: and Stays With dialog boxes.
The numbers below the dialog boxes show how many neighbors are necessary for the cell to
be either created (upper set) or remain (lower set). In order to change the rules, put an
integer between 0 and 8 in one of the dialog boxes, and press enter. If the number is already
in the conditions set, it will be removed, if not, it is added. Just play with it, you'll figure
it out.
The Pause/Go button pauses the simulation, as well as starts it back up again after it has been paused. The Clear button clears the window. The speed dialog box controls how long generations are displayed before calculating the next, in thousandths of a secons. It starts at 200, 1/5 of a second.
Clicking inside the simulation area, whether the simulation is running or is paused, allows the user to add and remove cells as he sees fit. Clicking on a full cell empties it, clicking on an empty cell fills it. Try Pausing the window, then clearing, and making your own patterns up, to see what will survive.
Go here for lots of very cool Game of Life stuff.
All textfields can be used while the simulation is in progress without changing the current state of the board, but changes to the rules take place immediatly after hitting Enter. Note that the number of neighbors is calculated for each cell before changes are made.