I have written a program that, if it was run on say your average supercomputer, would run very similarly to my initial multiple ant program except with a twist. When an ant lands on a coloured cell the cell won't revert to being white, it will instead turn a darker shade of the colour it currently is. To ensure this doesn't result in ants going in circles I have written it so that the cell alternates between being classed as 'coloured' or 'white' in the classical Langton's Ant sense.
I came up with this particular idea on a bus journey a couple days ago, when I realised that some of the patterns that have been cropping up are in their own way quite beautiful. I think this new iteration will result in some spectacular images.
A quick update on the developing maturity of my code:
- I have rediscovered For...Next loops. I am now saving about 5 minutes on each bit of code, as I don't need to go back at the end and find the counter=counter+1 that I have missed out. For...Next loops work by taking a number equal to some specified lower bound, running a piece of code with that number and then incrementing the number until the number equals some specified upper bound. Do While loops take a number and keep running the code while the number meets some condition, say being less than or equal to some specified upper bound. So they are virtually the same, except in a Do While loop you need to manually increment the number each time the code runs, which is a little bit tiresome when you have twenty of them.
- I have moved all of my colours into Hex, meaning I can get a much bigger range of colours. Read bigger as 300,000 times bigger.
And now finally we get to the reason I don't have anything juicy for you tonight...
The code I wrote tried to create a 22.8GB variable. Yes, a variable nearly 4 times larger than Skyrim. AND it was trying to create it in RAM. The thing is, I know exactly how to get around this as I did it that way in all of my previous code. I just happened to try something new and it has backfired spectacularly. The error was so big that instead of bringing up a basic error message Windows took control, fired off an error report to whomever those actually go to and restarted Excel. That has never happened to me before.
I will sort this all out tomorrow, by which time my computer will either have calmed down or comitted itself.
4651,
mathmo
No comments:
Post a Comment