Simple algorithm for crawling and reproducing ants, initially designed for a NodeBox workshop. Each time two ants meet, they produce offspring. However, nobody dies, so the population grows explosively.
brew install sdl2
./build.sh
./ants
Note that, because none of the ants die, the algorithm will keep on generating new ants, grinding the algorithm to a halt. That's sort of the point.
The src/ants.c
file has a number of #define
you can tweak to your heart's content. Try changing the RANDOM_SEED
.
To save out an image sequence, set SAVE_FRAME
to 1
. Frames will be saved out in TGA format in the OUT_DIRECTORY
.
The project uses the SDL, STB and NanoVG libraries.
This project is licensed under the MIT License.