ParlorNet
Turn-based game server for any computer, old or new
Clients | Protocols | Browsers | Telnet programs | Docs | Source

checkers/1 (draft)

Two players. Flags: staged. Rulesets: american (built); international planned (below). Options: limit=n (moves each with no capture and no man moving before the game is drawn: 10-200, or 0 for no limit; default 40). The time per turn is the server's turn= (protocol.md).

Seat 0 moves first. In american seat 0 is Black and seat 1 White; a frontend names them so. Colours are not otherwise part of the contract.

Static geometry (flag G)

BRD 8: the board is 8 by 8 (BRD 10 for international).

The dark squares are numbered in the standard way, 1 to n*n/2, n/2 to a row: 1-4 on the top row, 29-32 on the bottom row, each row left to right, as seen from White's side. The top-left corner square is light, so 1 is the second square of the top row and 5 the first of the next; 4 and 29 are the single corners, 1, 5 and 28, 32 the double corners. Black's men start on 1-12 and move towards 32; White's start on 21-32 and move towards 1. This is the numbering of published checkers games, of xcheckers and ICDS, and of play-by-mail servers, so their move lists read the same here. A frontend may turn the board round for display (each player's own side at the bottom); the numbers never change.

View lines

LineMeaning
B cellsThe board: one character per dark square, in square-number order (32 for 8 by 8). . empty, x a man of seat 0, X a king of seat 0, o a man of seat 1, O a king of seat 1.
C m0 k0 m1 k1Men and kings per seat.
W seatWhose turn it is; W - when the game is over.
Q phasemove (play a step), done (the turn's steps are complete: send END, or UND), draw (answer a draw offer: accept or reject), over.
L quiet limitTurns played in a row with no capture and no man moving, and the limit at which the game is a draw (twice the limit option; 0 for none).
J sq sq ...While a turn is part played: the moving piece's path, its starting square first and the square it now stands on last.
D seatWhile a draw offered by seat waits for an answer.
T, S, M, CLKCommon lines (protocol.md). M lists the legal steps, one per line, or accept and reject while a draw offer waits for this player.

The board is a dense string, as Reversi's rows are: 34 bytes for 8 by 8, against up to about 120 for a list of 24 pieces. A full view is about 110 bytes.

Move tokens

One step per token:

Staged turns

A turn is a series of steps (flag staged), as in protocol.md:

  1. If any piece of the side to move can jump, the turn must start with a jump (M then lists only jumps). Any capturing piece and any line of captures may be chosen; the number of pieces taken does not matter in american.
  2. After a jump, if the same piece can jump again it must: MOV answers OK more and M lists only that piece's next jumps. END is refused until the line of jumps is finished.
  3. A man that reaches the far row (Black's: 29-32, White's: 1-4) is crowned at once and the turn ends there, even if the new king could jump on.
  4. A turn whose steps are complete answers OK done; the player sends END (or UND to rethink). A simple move is one step.
  5. If the completed turn leaves the other player with no piece, or with no legal move, the game ends at once (END win), with no END needed.

Events

Applying an event needs no rules knowledge: each says which squares change and to what.

Size

Full view about 110 bytes (34 for the board). Typical event 10-25 bytes; a turn is one to a few step events.

Planned: international

International draughts as a second ruleset of the same type (the view lines, events and tokens do not change): a 10 by 10 board (BRD 10, squares 1-50, five a row, 20 men each, White as seat 0 moving first), men capturing backwards as well as forwards, flying kings (moving and capturing along a whole diagonal; a jump token then spans several squares, like 28x46), and the majority rule (the line of captures that takes the most pieces must be played; M lists only steps that begin or continue such a line). Captured pieces are taken off only when the line ends, and a man that passes the far row during a capture is not crowned unless the line ends there. The core passes the table's ruleset to the plugin in every request, so the plugin can tell the two apart.

Not offered

This doc on GitHub


 These pages cover every ParlorNet server. | Source code | ParlorNet is free software.