Robocode logo
Image via Wikipedia

Robocode is a very cool game where you program a tank to fight against tanks that other people have programmed.

As a programmer it's fun to write a frivolous program that's concerned with blowing things up instead of serious business rules.

Basically several tanks are placed in an arena and are tasked with destroying each other.  Each tanks runs code written by a contestant.  The code has access to the angle of the hull and turret of the tank, other tanks that the turret sees, and can rotate and move the tank and fire shells.

RoboCode debug graphics
Image by synapse via Flickr

At its simplest the code can just drive the tank around randomly, firing a shell whenever it sees an enemy tank.  At its most complex it can track other tanks based on their last known position, use neural networks, multiple threads - the sky is the limit.

I found out about Robocode several years ago but only ever really scratched the surface.

You can download code other people have written to test your program against theirs before submitting your code in a tournament.

From my point of view Robocode isn't ideal because the code the tanks are written in is Java, and although I've used Java before I don't have a lot of experience in it.  Having said that, Robocode is really the only game in town when it comes to this type of thing, and it is a lot of fun.

Reblog this post [with Zemanta]
blog comments powered by Disqus