Monthly Archives: October 2011

Let slip the ants of war!

So the Google AI challenge is back with a vengeance as of yesterday, and for better or worse I've decided to participate this year. I say "or worse" because it could end up being a bit of a personal obsession for the next few weeks, and given the calibre of the competition I'm not sure how well I'll be able to do but it should be a fun learning experience regardless. Naturally this means my current reworking of my vector and matrix math code will be on the back burner while this thing is going on.

I've already signed up and downloaded the C++ starter pack and then uploaded the default bot which is pretty mindless but at least it's something until I've had a chance to submit a bot with a reasonable amount of capability. I'm scared to look at my ranking at the moment since its the default bot, but my handle is "Heron" if anyone is interested in tracking my progress in the rankings. I'll update this blog as soon as I've had a chance to upload a revised bot.

Anyway, this year's competition involves the simulation of an ant colony. The goal for the bot is to collect food, grow the colony, and exterminate opposing ant colonies controlled by other players' bots. I've got an idea for a fairly simple bot that I'm currently researching. I thought I might find a possible algorithm to implement it in Donald Knuth's Art of Computer Programming but unfortunately he hasn't published that chapter yet. I'm devastated.

Everything old is new again.

This week the world lost Dennis Ritchie. I'm not going to try to eulogize this giant of Computer Science. Many other people have already done that, and besides, the man's work speaks for itself.

But it has made me interested in taking a new look at C. Over the past year, I've been using C++ on my graphics engine and the year before that I spent exploring Haskell. I've had mixed success with these. While they're both very nice languages it seems to me that for every problem each one of them solves, other problems are created. So I think I'm going to go back to C for a while and rewrite my vector and matrix math code in that language instead of C++ (or Haskell).

Much of my reasoning for this is based on Joel Spolsky's Law of Leaky Abstractions. It seems to me that while object oriented and functional programming abstractions can be very helpful, they can also be incredibly frustrating to deal with when something doesn't work and you have to go track down a bug. So I think a good case can be made for writing code that keeps as much practical information on the current line as possible - in other words code that is self documenting. And I think C might be a good way to do this. After all, sometimes less is more.