Home | Register | Login

Example Players

The c++_example and java_example directories provided in capture.zip contain sample players implemented in C++ and java. The source code for these will demonstrate how a player is to interact with the game, and they may give you some ideas about how your own player could operate. You can compile these independently and then run them against each other in the game using a command like the following:

java -jar capture.jar -player exe c++_example/march -player java java_example.Eight

Source code for the java is stored in a java_example subdirectory and is given a matching package name. Keep in mind that submitted players implemented in Java cannot be organized this way; they must be defined in the default package. The Java example has been organized this way only to simplify distribution.

C++ Example Player

The C++ example player, March, just hast the sled march across the playing field, drawing large circles. The bumpers follow a zig-zag path across the upper and lower portions of the field, trying to bump pucks into the region that the sled is trying to capture.

Java Example Player

The Java example player, Eight, uses the sled to draw a figure eight on the playing field. The bumpers try to move pucks into the figure eight so that their color is changed.