Source
Code
To play, set the
options on the left hand side of the screen and press start to
begin. Once the simulation is
started, press stop to temporarily stop the simulation. Also, pressing clear will clear all
the ants and stop the simulation.
It is also possible to select an ant by clicking on the ant. The following options are available:
Mutate: one of the directions is changed for the selected ant
Random: all of the directions are
changed for the selected ant
Set Rule: the rule is changed for the selected ant
Delay: Sets the delay between moves
of ant. The delay is in
milliseconds.
Cell Size: The size of each cell in
pixels. A rectange is drawn for
each cell.
Population: The number of ants active at one time.
Scroll: Determines the action to take when the ant reaches the
boundaries which include:
Die: The ant stops
moving.
Wrap: The ant moves to the opposite side of
the screen.
Bounce: The ant changes
direction.
Rule: The rule which is used to control movement of the ant as
follows:
1 State-2 Color: Cell
can be black or white
when black: the ant turns to the right and moves
forward 1 cell
when white: the ant turns to the left and moves
forward 1 cell
when the ant leaves a
cell, the color of the cell is changed
1 State-3 Color: Cell can
be black, white, or red
when black: the ant turns to the right and moves
forward 1 cell
when white: the ant moves forward 1 cell
when red: the ant turns to the left and moves
forward 1 cell
when the ant leaves a cell, the color of the
cell is changed
1 State-4 Color: Cell
can be black, white, red, or cyan
when black: the ant turns to the right and moves
forward 1 cell
when white: the ant turns to the left and moves
forward 1 cell
when red: the ant turns to the left and moves
forward 1 cell
when cyan: the ant turns to the right and moves
forward 1 cell
when the ant leaves a
cell, the color of the cell is changed
|