CIT 594 RoboTalk Hunt
Spring 2007, David Matuszek

Purposes:

General Idea:

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" (FUEL, ARMOR, 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.

Details:

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 WALLs. 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
 

A: armor
E: enemy
F: fuel
W: wall
Z: zap gun
.: empty space
^, >, v, or <: you

Your robot will start in one corner, just inside the walls: That is, at (1, 1), (1, COLUMNS - 2), (ROWS - 2, 1), or (ROWS -2, COLUMNS - 2). 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 ENEMY or WALL), or you can move right through it as if it weren't there (except an ENEMY or WALL). You cannot move onto or through enemies or walls.

To take an object, move to the same square that it is on and take it. When you drop an object, it is put on the square that your robot is in.

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 <action>.

Your score will be the total number of things that your robot has collected and returned to its home square.

Provided code:

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.

Due date:

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.