In the distribution binary, the c++_example
and java_example directories contain sample players
implemented in C++ and Java. The Java player is already compiled and
ready to try out. The source code demonstrates
how a player is to interact with the game, and these examples may give you some
ideas about how your own player could operate. Of course, these
players are not too smart. Using them as a starting point, you can
probably do much better.
You can compile these players independently and then run them against each other in the game using a command like the following. If you've compiled the example players, and left their executables in the same directories as the source code, you should be able to run this command from the top-level directory of the expanded game distribution binary :
java -jar bbr.jar -player cpp c++_example/hotPotato -player java -cp java_example HotPotato
Source code for the Java player is stored in
a java_example subdirectory, but its code is defined in
the default package. The -cp java_example on the command
line adds java_example to the class path before running
this player. If you put your Java player in the current directory,
you won't need the -cp option.
The C++ example player, hotPotato, tries to pilot the boat with the baton toward the next rally point on the course. The other boats randomly choose locations on the field and head toward them. If two boats are close enough, the player may choose to pass the baton between them (that's where the hotPotato name comes from).
The Java sample player, HotPotato, is just a Java port of the C++ player.