This is currently done as a zero player game...
I wrote many different versions of this.
maybe will clean up
and add some of the others some time. I learned about the ant game from
Ivars Peterson's book, The Mathematical Tourist.
In the ant game, the ants move on a trouchet path, and after moving through (or while moving through or whatever rule you decide) they change the direction of the path).
It's nice to do this on a really big board and leave a trail, but takes up more GPU.
In this version, I have 4 ants. Fun fact: no matter how many ants, if they all start on different squares, they never colide. But they can enter the same
square on different paths. When this happens, I decided not to change the path
directions. Could use a different rule.
I like to look for cycles, i.e., from a particular initial position, how long does it take to get back to that position, if at all? Eventually everything ends in a cycle, since this is running on a torus.
I restricted to 4 ants just to reduce the number of uniforms needed in the
glsl, could increase a bit, but am limited. The dots apear when you move the mouse over the screen. Probably none of this works on a touch screen.