Robocode is a program that lets you program your own robot to fight other robots on a virtual battlefield. The robots can run around, scan for enemies with a radar, and shoot with a gun. The more strategy you put into your robot, the better it will fair in the arena.
Getting Robocode installed and working with eclipse was easy with the help of the video guide. I had no problems getting it all to work. The tricky part came with programming the robots.
We had 12 robots to program. Each focusing on one of the 3 main actions of the robots: running, targeting, and shooting. Getting the robots to move around wasn't too difficult. I couldn't figure out how to use the trigonometry so I had to resort to vertical and horizontal movements. The tracking gave me a lot more trouble and my robots still aren't working the way they're supposed to. I couldn't get the robots that required tracking of a single enemy robot working correctly. The firing wasn't as difficult. The shooting was pretty straightforward after the tracking robots. I used the following page and it was really helpful. Link
Robocode has been a really interesting way to practice programming. It was really different seeing the code you write reflect robots fighting each other on screen. It was certainly more entertaining than the regular coding. I think this is a great way to get students more interested in programming and more courses should try to incorporate something like this to break the cycle of plain programs week after week.
Robocode project: Download
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment