Home >Puzzles >One Ant

2 ANTS

See Langton's Ant on Wikipedia

Idea: On a field of cells, that can be black or white, two "Ants" move using very simple rules. For the basics go to one ant
  • Whenever an "Ant" enters a white cell, it will make the cell black and turn in one direction to the next cell.
  • Whenever an "Ant" enters a black cell, it will make the cell white and turn in the opposite direction to the next cell.
  • When two ants arrive at the same time at the same point then the "youngest" ant will skip one step
  • Alternatively they will create offspring, which will incubate 2 steps and then get to live as well; incubation time is reset to 2 if within these 2 steps a new ant is again created, gradually slowing down increase in ants
While each "Ant" seems to be moving randomly, they actually make an interesting pattern, which suddenly changes after about 10.000 steps.
You can set various parameters before making the ants move. Then you can start and stop the ants.

I stumbled over a "social" stimulus for systematic roadbuilding: Using following parameters, a 3rd ant was born after 288 steps (starting to move after 290) and a highway is started already at ~ 950 steps!
100 x 100 ; black; 11000 steps; 100 steps/second; start "up"; on white turn "left"; ant 1: 50 - 48; ant2 50 - 52; Offspring yes. 2 steps incubation
Try it yourself with e.g. 50-49,50-51, or with incubation time 3 or 4. What a small difference can do!

Field:
Width and height : cells
Color                   : Black White

Ants:
Make               : steps
with                 :        steps/second
startdirection : Right Left Up Down
on white, turn : Right Left

startingpoint Ant 1:Row Column

startingpoint Ant 2:Row Column
Offspring: No Yes
Incubation time: steps (max 50)


visitors have visited my site, since November 2001 as counted by