In the distribution binary, the various example directories contain sample players implemented in each of the available competition languages. The source code for these demonstrates how a player is to interact with the game, and they 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 build 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 coercion.jar -player cpp c++_example/gather -player java -cp java_example Migrate
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, gather, tries to collect markers in its starting corner of the field. If the player can keep this space from changing color, it can use it to coerce these markers to its color. The player then tries to push the markers to other parts of the field to coerce the color there.
The Java sample player, Migrate, simply takes each of the markers that start out in the player's color and tries to push them to the edge of the player's territory. If the player is able to coerce these boundary regions to its color, it pushes the markers to a new boundary edge and expands the territory further.
The C# sample player, Migrate.cs, is a port of the Java sample player, it takes each of the markers that start out in the player's color and tries to push into new territory to convert it.
The Python example player is a port of the C++ player, gather. It tries to convert markers by moving them into it's home space, then it moves them out into the field to try to claim new territory.
Coming Soon.