Each blue hexagon is a artificial life form containing simulated DNA in the form of computer code. Each green
hexagon is food. Life forms must eat food to survive. If a life form eats enough food, it will produce a new
life form. The DNS of the new life form has a chance of mutating. As the simulation continues, the amount of
food decreases, leaving only the life forms with the best DNA to survive.
Display
Run Button - Starts the simulation, or continues the simulation if it was paused
Pause Button - Pauses the simulation once started
Step Button - Causes the simulation to progress one and only one turn
The World - The hexagon filled world contains blue, green and white hexagons. The blue hexagons are
artificial life forms, the green hexagons are food, and the white hexagons are empty spaces.
Time - How many turns have elapsed since the beginning of the simulation
Available Food - The amount of food currently available in the world
Oldest Age - The age in turns of the oldest life form currently alive
Life Forms - The number of life forms currently living in the world
Predominant DNA - The most commonly found DNA. The number to the right is the number of life forms with
this DNA.
Secondary DNA - The second most commonly found DNA.
Mutations
When a life contains over 500 points from eating food, it will produce a new child life form. The parent will
give a third of its energy to its child. The new life form has a chance of mutation. When a mutation occurs, one
or two lines of code are randomly added, removed or replaced. You many notice that predominant life forms may
develop a large amount of junk code, that appears to serve no purpose, however junk code can serve a few
purposes. Junk code can slow down the speed of a life form because it takes time to execute, which may be
beneficial by allowing more food to drop before taking expensive actions like moving forward and eating. Junk
code can also reduce the potential of harmful mutations by reducing the likelihood that beneficial lines of code
are removed.
The Code
The DNA contains lines of executable code. Each life form contains a set of code, and a location of the next
line of executable code. Each turn the next line of code executes. Once the code completes, it starts again from
the top of the DNA.
move forward - The life moves forward one hexagon. Life forms can move over food, but cannot move in a
hexagon occupied by another life form.
turn left - Turns 60 degrees left
turn right - Turns 60 degrees right
eat - Food in the same hexagon is eaten and stored as energy to perform future actions.
m++ - Increments the variable m by one. The variable m can only be an integer between 0 and 9. If
m is greater than 9, it becomes to 0.
m-- - Decrements the variable m by one. The variable m can only be an integer between 0 and 9. If
m is less than 0, it becomes 9.
m = number - Assigns m equal to the value of number.
m = look forward - Assigns m a number based on the adjacent hexagon directly ahead. If the
hexagon is beyond the edge of the board, m = 0, if a blank square, m = 1, if food without
life, m = 2, if life, m = 3
m = look left - Assigns m a number based on the adjacent hexagon 60 degrees to the left.
m = look right - Assigns m a number based on the adjacent hexagon 60 degrees to the right.
m = smell - Assigns m how much food is in adjacent hexagons, including food under the life form.
m = energy - Assigns the variable m a random integer from 0 and 9.
m = random - Assigns the variable m a random integer from 0 and 9.
if ... go to label number - if the condition is true, continue code execution after the
corresponding label.
label number: - A label used by if statements. The label is not executed and does not require a
turn to execute.
Energy
When the simulation begins, each life form contains 100 points of energy. Food is dropped in the world randomly
each turn. As the simulation progresses, less food is dropped each turn until it is very difficult for life to
survive. Eaten food is converted into energy. Each line of code takes at least one point of energy to execute.
Eating and moving forward take an additional 10 points of energy. If the energy stored in a life form drops to
zero, the life form dies
About
We hope you enjoy this evolution simulator. Run the simulation several times to see if you your evolved life can
live over 200,000 turns, and look at the different DNA algorithms that form. You will be surprised by the
variety of algorithms that can evolve.