My Ant Can Beat Up Your Ant
In college, one my CS assignments was to create the “brain” of ant. We were given a virtual world — a beach — that had food pellets scattered about it and a slowly eroding shore (with an uneven water line that ebbed & flowed). Your ant lived by eat pellets every so often (your ant had a few quantum levels of hunger) and avoiding the water. (Touch the water and you die.) Using a “radar’ of sorts, of the immediate area around the ant, you had to figure out how to make it survive as many “turns” as possible. Our particular assignment was to make the Ant live as long as possible, no floor given on the minimum number of turns.
At the time, I was one of the senior tutors in the computer lab. Meaning, I had the access code and could come & go whenever I wanted, and most valuably, stay past the labs closing. Several of my fellow tutors where also in the class, and we in turn, would let our fellow classmates stay late with us. Thus, the night before an assignment’s due date, it wouldn’t have been that uncommon to find 5 or 6 working in the lab during the wee hours of the morning.
It was with this group that I remember each of us working on little ant brains. Except we each didn’t have one little brain, we each had multiple permutations going. For in a fantastic game of male one-upmanship, we each kept trying to have the ant that lived the longest. We all got to 30 or 40 fairly quickly, pursuing simple rules — if water close, move away; if on food, stay until you’ve eaten it all.
Then watching how your ant did, you’d see your ant sitting on the food with the tide approaching and holler “Get off the food, you @!#$ ant!” Of course, he wouldn’t, because you didn’t tell him to. So twiddling, and now your ant new to stay on food unless death was eminent. Some additional twiddling, and your ant lives close to 100 turns.
That probably would have been a good stopping point. We all even hit that before the labs normal closing hours. But no, each of us felt driven on by making our ants that much smatter. Of figuring out how the other guy’s ant is somehow living just that little bit longer. So slowly we each added more and more heuristics. It got to the point where each of us had ants that lived well over 500 turns. Only since these were old computers. And 500 turns could take a good 15-30 minutes to run.
In an otherwise empty computer lab, that’s not a big problem. Each of us slowly took over the computers around us to run variations on our ants. It started simply enough — one computer to run the simulation while you coded, but naturally finished with all the machines in the lab being evenly divided between us, each having the half-dozen or so computers in our aisle. It was only grudgingly that we started to give a few up when the lab opened at 9am. And it was only grudgingly (and tiredly) that we headed off to class at 10am to turn in our ant brains.
Our ants were smarter now. They knew things such as the way to maximize the amount of food on the board was to eat the pellets closest to the shore first, before it was unreachable and covered with water.
In hindsight, we probably could have stepped back at any point after midnight — 1am or 5am – and realized the average student had neither the time, nor the resources, nor the psychosis to do what we did. Still, confidence flagged by exhaustion, in the few minutes before class, as students slowly trickle in, we interrogated our peers on how long their ants lived. It was with blank faces we listened to response of 60-90, the highest being around 150. And it was with blank faces they heard our response, each of us having finished around 1,000 (the point at which there was almost no beach left).
An uncertain quiet having set on the room, the professor arrived, and silently collected our assignments — a silence only broken when a student asked how many turns had been the minimum. Our professor, a generally nice fellow, responded anything over 50 or so would probably be fine.
50. Five. Zero. Our ants lived to a thousand. One. Comma. Zero. Zero. Zero.
In a world of children we had built Nietzsche’s Uber-ant.
Knowing all this, perhaps you can understand the warm feeling in the cockles of my heart in coming across this on Slasdot.
I wonder if you can use code written in Lisp.
