The id for Chess is "chess". This is the name that is returned from the GET games request, and it used in all urls to replace the {game} parameter.
An army is a configuration for your half of the board.
The environment lists all the pieces on the board.
{
"board" : [
["", "", "", "", "", "", "", ""],
["", "", "", "", "", "", "", ""],
["", "", "", "", "", "", "", ""],
["", "", "", "", "", "", "", ""],
["", "", "", "", "", "", "", ""],
["", "", "", "", "", "", "", ""],
["", "", "", "", "", "", "", ""],
["", "", "", "", "", "", "", ""]
]
}
Each element of "board" corresponds to a row, such that when looking at the JSON representation, it looks as the board looks for the first player. Each element of a row is either an empty string indicating "no piece", or a string of the form "x,y" where x and y are integers. x denotes the player owning the piece, and y denotes the piece id.
Piece ids for the basic chess pieces are as follows:
The environment is always as above, there is no player-specific redaction.
The turn object should have at least values for "from" and "to". Each are coordinates (an array of a pair of values) corresponding to the locations on the board. Coordinates are specified with [0, 0] being in the bottom left. This is not the same as the coordinates used in the JSON array above.
{
"from" : [0, 0],
"to" : [0, 1]
}
Sometimes, additional information will be needed. Such as when promoting a pawn.
See the games page for details on making the request.
Whenever a player makes a successful move, an event is fired of the form:
{
"player" : 1,
"from" : [0, 0],
"to" : [0, 1]
}
There are some rule differences from the original game.