Ants that demonstrate emergent behavior based on simple rules.
Two rules govern how each ant moves:
- If the ant is on a white square, it turns left 90 degrees, and moves forward one grid.
- If the ant is on a black square, it turns right 90 degrees, and moves forward one grid.
When the ant leaves a grid, the color of the grid it left is inverted.
delay
: Milliseconds between each ant move
randDir
: Whether or not to initialize ants with a random direction
cellSize
: Size of each grid in pixels
Click
: Add ant
Spacebar
: Toggle pause (also displays step number)
R
: Reset