skirmish.py: IMCS client assistant

Max Goodman's skirmish.py script is intended to assist in the connection of a MiniChess computer chess client to the IMCS Internet MiniChess Server. It should allow you to plug your Mini Chess bot into the IMCS server and play games with a few simple modifications to your output.

The source code is on github.

Usage

To use skirmish.py, run it with two arguments, specifying the player types for white and black. For instance, here is how I invoke it to play a game with Bart's player, Tarzan:

  python skirmish.py -v "run ./Play -w NegamaxPruned -b IO" \ 
    "imcs://user:password@svcs.cs.pdx.edu:3589/accept?name=tarzan"

Player types can be one of the following:

  • "-" (communicate with standard in/out)
  • "run COMMAND" (communicate with standard in/out of the command)
  • "imcs://user:pass@host:port/PATH" (connect to an imcs server)

The IMCS path specifies what game you would like to connect to. You can use "/offer" to offer a game of the player's color. Use "/accept" to perform a search for offers, given query constraints. For example, "/accept?name=tarzan" will find and accept the last offer in the list by Tarzan. Valid query arguments include "name", "rating", and "id".

For more information on the available options, please refer to --help.

(NOTE: you will need to register on IMCS before playing; simply telnet/netcat into the host:port and enter "register ".)

Modifying Your Player

To get your player to talk to skirmish.py, you'll need to alter the semantics of your player a bit. The changes are mostly unobtrusive, so you might simply want to modify your current code, or you can add a separate mode/player module to your program.

For a quick overview, the game loop should look like this (angle brackets denote placeholders):

  // Example: playing as White

  While not (end of game):
    output "! <my move>"  
    input  "! <opponent move>"  (e.g. a2-a3)

  output "= <result>"  (one of "W wins"/"B wins"/"Draw")

In particular, if you have a simple player on the terminal already. you only need to change 3 things:

  1. When your program moves, it must output a line starting with "! ", followed by its move in notation form.
  2. When reading the opponent's move, your program must take a move in notation form, prefixed by "! ".
  3. At the end of a game, your program must output the result, prefixed by "= ", and quit.

All lines that do not start with the strings "! "/"= " will be ignored, so feel free to add debugging output. You can use the "-v" verbose flag to see your program's output while skirmish.py is running.