Tuesday, 26 June 2012

2 to 54, but is n possible?

After an hour's work I have amended my program so that it supports up to 54 ants running at once. Not quite n, but that is the largest number of colours I can easily use in excel cells. There is probably something I can knock together using hex but I will look at that tomorrow. Or perhaps some sort of alternating colours? I might try it even if I do figure out hex, because who can resist a wild spotted ant?

So my maiden use of my new 54-ant toy was with 3 ants, which turned out to be pretty unspectacular as the ants were so spread out they didn't even interact. So I reduced the size of the spawn area, cranked up the number of turns, and for good measure tried it with ten ants. Below is the result.
Ten ants running at once.
Just this one quick run has already thrown up a lot of interesting ideas. 
  1. Cyan and Light Green collided at the very start of the run in such a way so that they followed the other ones path back to the starting position, ERASING the path as they went. Fortunately by the time they had regrown Blue had gotten in the way or we might have been stuck in an infinite loop.
  2. It is possible for ants to hijack other ants highways, moving in an almost straight line along it. My first observation of this was Light Green climbing Red's, coming back down the other side and in the process forcing red to create a second highway back into the spawn area.  
  3. Several times ants were in the right direction and cell such that they got caught following another ants path. This occurred with the Olive ant erasing most of Light Blue despite the fact that Light Blue's path was interleaved with Dark Blue.
  4. Pink just sat back and watched the carnage. We can see the distinctive shape of an unmolested Langton's Ant, a clear indicator that despite the bizarre goings on that our code in fact runs correctly.
I think that tomorrow I will try to increase the number of ants I can have, find a way to highlight the position of each actual ant and to create an optional elastic barrier around the edge of the spawn zone.

31,

mathmo

No comments:

Post a Comment

About Me

I am a mathmo (mathematician for anyone not familiar with Cambridge slang) studying at the University of Cambridge, and this is the blog of my summer project on Langton's Ant. This project was dreamt up one evening in the college bar when I was showing some of the compscis (computer scientists) my old visual basic excel macros and stumbled across a very basic Langton's Ant. What I showed them was just one boring black ant. By the time I left the bar that morning I had progressed to two coloured ants colliding with each other, the demo macro that most of this project is built from. Through this project I hope to expand my knowledge of visual basic, encourage others to mess around with maths on their computers, and to make a lot of pretty pictures. I will aim to keep my language fairly non-technical, but feel free to comment if you have a question or even a suggestion on how to improve my code. Here it goes...