Checkers Middleware


This software provides a way to run pairs of checkers-playing programs against one another or to run several programs as part of a competition.

The programs included were developed for a UNIX environment.


Location of Software

Those using this software on the CS network should run the programs directly from:
/cs/course/cs540/checkers/
Others may download copies of the programs.


Rules

The checkers middleware enforces (more or less) the standard rules of checkers (see http://www.jimloy.com/checkers/rules2.htm).

Here, we describe how wins, losses and draws are determined by this software ("player" refers to a checkers-playing program):

A player loses if...

The above rules will cover the cases when a program "gives up" by either producing some output that says so (e.g., "Give up!", which is an invalid move) or by exiting. They also cover other cases, such as when a program crashes.

A draw is called if...

Obviously, when one player losses, that determines a win for the opponent.

See the middleware program for some options that can control the above rules.


Input/Output

The checkers middleware requires checkers programs that adhere to the following input/output scheme:

Input
The program accepts a move (from its opponent) via standard input. Such a move will be contained on a single line. The program should expect no other input than its opponent's moves.

Output
The program outputs a move (to its opponent) via standard output. Such a move should be output as a single line. The program should produce no other output than its own moves.

Loop
The program should loop, first reading in a move from its opponent, producing a move, reading another move from its opponent, etc.

Move Representation
Moves should be specified using the standard numbers for checkers board positions:

      Red
  01  02  03  04
05  06  07  08   
  09  10  11  12
13  14  15  16  
  17  18  19  20
21  22  23  24   
  25  26  27  28
29  30  31  32   
     White
A move should consist of a space-separated list of the initial position and all positions traversed by the checker during the move (i.e., in the case of a jump there may be more than one).

An example move for White might be "24 20". A double jump for Red might be "2 11 18".


Note: This representation of moves is slightly different than the standard, which does not require all positions along a jump to be specified when they are obvious. This software does require all positions.

Red or White
The program must determine whether it is Red or White based on the first move sent to it. If that move is "0 0" (which is not a valid move) then it is Red and must make the first move. Otherwise, it is White and must respond to the first move sent to it from Red.


Programs

The checkers software consists of 3 programs written in Perl and one Perl module:


Checkers middleware originally by Jeffrey Considine <jconsidi@cs.bu.edu>.
Modified by Robert I. Pitts <rip at bu dot edu>.