Ants leave the nest and search for food. An ant that finds food takes a piece home, and leaves a scent on its way. Other ants follow the scent, and a trail grows. Place food and rocks, and see the trail change.
The ants come out of the nest.
Click the land to place a pile of food.
An ant that searches has the rule flow with a field that is a function of a position: the direction to the stronger scent near the ant. Where the ground has no scent, the field gives no force, and the ant wanders.
The scent is a grid in an ETS table of the land. An ant with food marks its cell, and an ant that searches reads the cells near it. No message goes from ant to ant. The scent fades with the time.
The mark of an ant with food is stronger near the food than near the nest, so the scent points to the food. A cell keeps its strongest mark. A short way gets new marks more frequently than a long way, and its marks are stronger, so the trail takes the short way.
An ant that touches food takes a piece, and changes its rules: it goes home with seek, and leaves scent. At the nest it gives the food, turns back, and searches again. An ant with food is green.