594 RoboTalk Hunt
Spring 2007, David Matuszek
Your Robot will be placed in one corner of a board; other robots will be placed
in other corners. Your object is to collect as many "goodies" (
ZAP_GUNs) as you can, and return to your corner with them. Other
robots will be doing the same.
Write a program in the RoboTalk language to do this.
If I can get the GUI code working properly, we can have a "playoff" to see which program works best. In any case, you should write your RoboTalk program with this in mind.
The controlling program will place fuel, armor, and guns randomly in a rectangular
board of some size. All the outside squares of the board will contain
That is, the board will look something like this (though probably larger):
W W W W W W W W W W W E . . . . A . E W W . . . . . A . . W W . . . Z F . . . W W . . . . . . . . W W . . Z A E . . . W W .> . . . . . Z . W W W W W W W W W W W
Z: zap gun
.: empty space
Your robot will start in one corner, just inside the walls: That is, at
Other robots (not more than 3) will start in other corners. Your object is
to collect as many things as you can (not including enemies!) and return
to your corner with them. You do not need to drop them; just stop (by reaching
the end of your "main" program).
Each robot will start with 10 hit points. If you have a zap gun, you can zap objects with it.
When a robot drops to zero (or fewer) hit points, it is removed from the board.
You can play agressively if you like (zap other robots a lot), or not; it's up to you.
When you move, you can move onto the same square as an object (except an
or you can move right through it as if it weren't there (except an
You cannot move onto or through enemies or walls.
To take an object, move to the same square that it is on and
drop an object, it is put on the square that your robot
Your robot can see only the first thing directly in front of it. It can smell anything in the same square or anything in one of the eight adjacent squares.
Robots take turns. You can do as much computation as you like (within reason);
your turn ends when your robot performs an
Your score will be the total number of things that your robot has collected and returned to its home square.
There is an updated version of RobotStandIn.java. It does most everything except hit points (zapping an enemy once removes it from the board).
There is a collect_everything_2.txt file, which is somewhat better than the previous version, but doesn't really "play the game," and gets stuck in loops occasionally. It's a sample program, nothing more.
This is intended to be a fun project, and will be worth a smaller number of points than usual--maybe 25 or 50, possibly more for "winning" programs.
Zip the complete Eclipse project and submit via Blackboard before midnight, Tuesday, April 17.