I've reproduced this tutorial from its original location at http://www.ecs.soton.ac.uk/~ao/Snippetbot_tutorial.html. Please note that on a brief rereading of the code it has glaring errors with regard to the scanner: it doesn't consistently use radians consistently, although it does still work largely as expected. Note that contrary to the assertions below, if you have questions I probably can't help you, as it's been many years since I've touched Robocode. Still, if you want to contact me, you can get me at ao at ecs.soton.ac.uk. Hope it's useful!
Well, here it is.... The much promised tutorial on creating
a more advanced robot. I realise the site's a little basic at the
moment, but I should have it looking a bit more pretty in a couple of weeks
time when I'm less busy ;)
If you are really just starting in robocode, you may find some of the
code a little bit confusing. If you are a more advanced programmer
and/or have had a play with robocode already, I hope this site can answer
your questions. The steps in creating SnippetBot are shown below.
These include the code for a narrow radar scan, linear predictive
targeting, and many useful functions such as getting the bearing to a point.
Please note that snippetbot uses conventions such as radians, using
absolute x,y coordinates, and as little as possible code in events. These
are all good robocode programming practices.
Without further ado, here is the code cut up into chunks finger food stylee
(the full version is also below):