The display area shows a map of the simulated world with wrap-around edges.
The green dots are food.
The blue, magenta, and red dots are critters.
Each critter has a set of "X" genes and a set of "Y" genes.
These genes determine the direction of movement at each time step.
"X" genes determine left-right movement and "Y" genes determine up-down.
At time zero, the first gene in a set is used; at time one, the second;
at time two, the third; and so on until the time resets back to zero.
There is a fifty-percent chance that a critter will move in a direction
determined by its "X" or "Y" gene at a given time step.
So one-fourth of the time it will move in both the "X" and the "Y" direction,
one-fourth in just the "X" direction,
one-fourth in just the "Y" direction,
and one-fourth of the time it will not move at all.
At every time step, a critter consumes energy whether its move or not.
If a critter runs out of energy, it dies. If a critter moves to a green
food dot, it eats the food and gains energy.
When a critter eats enough food, it reproduces.
Its child is exactly like it except that there is a small chance that its
genetic movement pattern will be slightly different as a mutation might occur in
one of the genes. When a mutation does occur, the mutant gene is determined
The "Garden of Eden" is an area where the food is continuously replenished.
Critters that wander around in the Garden tend to spawn descendants which evolve
into blue "twirlies". Twirlies like to run in circles so that they can keep
coming back to the food in the Garden of Eden.
Critters outside of the Garden of Eden tend to evolve into red "cruisers".
Cruisers tend to more or less move in straight lines sucking up food and
clearing a path behind them. Since food is not automatically replenished in
areas outside the Garden of Eden, twirlies outside of the Garden tend to die out
after they have eaten all the food in their area.
A blight will immediately destroy all of the food outside of the Garden of Eden.
Any twirlies in the Garden at the time of a blight are likely to survive but
cruisers will pass right through the Garden into the blighted areas with no food
Manipulate the food distribution so that you can see the critters as a whole
evolve from cruisers to twirlies and back again.
Disable the Garden of Eden to make them evolve into Cruisers.
Re-enable the Garden of Eden and cause a blight to make them Twirlies again.
Disable the Garden of Eden and drop the food growth rate as low as possible
without the critters going extinct. Observe how the cruiser foraging groups
converge on a single wave of critters moving abreast.
With the Garden of Eden enabled and the food growth rate turned down low,
cause a blight so that there are no critters outside of the Garden.
Watch how long it takes for the food to grow back enough to let some critters
survive outside the Garden long enough to reach the edge.
Click on the display area to create a new critter. If there are the maximum
number of critters already, the new critter will not be created. The simulation
starts with the maximum number of critters.
The Reset button restarts the simulation.
The Blight button removes all food outside of the Garden of Eden.
The Food growth rate slider varies from zero to twenty per update.
The Garden of Eden checkbox toggles the food in the Garden on and off.
The Speed slider adjusts the simulation update rate.
The Display Update Rate checkbox displays the sampled rate.
The Display Time checkbox displays the current real-world time.
Use the Pause checkbox to suspend updates while you on the display area.
I wrote this program based on a similar program described in an issue of
Scientific American magazine from 1990 or earlier.
The first version I wrote was in Turbo Pascal sometime in 1989 or 1990 for a
biology class at the United States Air Force Academy (USAFA).
The second version was in QBasic between 1993 and 1995 which served to keep me
entertained while I awaited results in a neurobiology lab course at the
California Institute of Technology (Caltech).
I wrote the third version in 1996 as a Java applet.
I revised it sometime between 2002 and 2004 so that it could be deployed as part
In 2006, I fixed a bug in the code and the
In 2022, I converted the Java code to the Rust programming language.
Since Java applets are no longer supported in Web browsers, I compiled the Rust
code to WebAssembly (Wasm) to get it to run in a webpage.
Rust and WebAssembly
research page for links to tutorials that I wrote on how to do this.