Tuesday, 26 June 2012

Introductions

Okay, I am writing this first post at what I had originally planned to be the end of the project, but today I revised that decision. 

To get you up to speed: I have some basic functionality with a central menu that calls the demo as well as the clear option. The demo is two of Langton's Ants separated 100 cells each way and going in opposite directions. I have found that this set up was the simplest demonstration of the possibilities that multiple ants offer. (The clear option simply sets every cell on the spreadsheet to blank.)

Demo option produces this simple collision.
Demo option produces this simple collision.

This afternoon I decided to see what would happen if I ran the demo multiple times without clearing the sheet. The result was beautiful.

The result of the demo being run 8 times in a row.
At first the two ants were in perfect symmetry, but eventually they moved into a square at the same time. The way I had written this code was that the red ant progressed on each turn before the green ant, hence when they 'collided' they were thrown out of symmetry as expected. But what happened next was most definitely unexpected. The two 'knots' formed where the highways intersect are perfectly symmetric, but occurred AFTER the break in symmetry at approximately the same time for both ants.

I think this is rather a case of
"Now this is not the end. It is not even the beginning of the end. But it is, perhaps, the end of the beginning." - Winston Churchill
I now plan to expand and improve my macro, on my wish list so far are:

  • A border so that each ant terminates when it reaches the edge of the screen.
  • An option for the user to have as many ants as they like.
  • 'Passive' and 'Aggressive' modes, where ants annihilate any ants they 'land' on.
  • Separate the macro into its own program. (Don't hold your breath on this one.)
I won't upload my code yet as there is always the risk that one of you might actually have access to a velociraptor.

1,

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...