In-Depth

Build the best; destroy the rest

IBM has come up with a novel way to help budding Java jocks develop their coding chops. It's called Robocode, and with a reported 80,000-plus downloads, it is a certifiable craze—at least in IT circles.

Available on IBM's alphaWorks Web portal site since July (2001), Robocode is a game that teaches the Java programming language by helping users to create Java "Robots," real Java objects that battle it out onscreen against other robots. As users play the game, they learn to write Java code, handle events, create inner classes, and other coding skills.

According to the folks at alphaWorks, Robocode uses a custom security manager to allow custom Java classes written by anyone to run safely on most systems. These classes extend a robocode.Robot class, exposing methods such as ahead(100), turnLeft(90), and fire(1) to allow the object to interact with the game.

The bots take the form of battling tanks, the multicolored graphics are good, and it has the feel of a combination of Logo and CoreWars. Bots with names like Shorrockin, Rapture, SquigBot, and Wolverine, reside in Robocode repositories.

Veteran programmer Mathew Nelson developed the project. Nelson joined IBM in 1991, and he calls Robocode a "pet project" that combines two of his passions: computer gaming and programming. Based in Cambridge, MA, Nelson is currently a Staff Software Engineer in IBM's Internet Group.

The game has spawned a number of Robocode Web sites, including the Robocode Repository (http://robocode.turbochicken.com/), the RoboLeague (http://user.cs.tu-berlin.de/~lulli/roboleague/), Robocode Fanatics (http://robocode.diverman.com/), the Robocode Yahoo Group (http://groups.yahoo.com/group/robocode/), and the Robocode Bot Exchange (http://home.covad.net/~gchomuk/RoboCode/).

The latest update (Nov 29, 2001) contains a new Robot Packager, .properties files, .jar files and "robotcache," Robot Database, Robot Selection dialog, .html files, major scoring changes, the ability to write to a data directory to store persistent data, improved event priorities, new setInterruptible() call for event handlers, improved collisions, new Bullet objects, numerous bug fixes, and a Help system that allows the user to chose the browser.

For more information, and to try the game, visit the Robocode home page at http://robocode.alphaworks.ibm.com/home/home.html.

For more Developer Corner, go to: http://www.adtmag.com/section.asp?section=specialreport.

About the Author

John K. Waters is a freelance writer based in Silicon Valley. He can be reached at [email protected].