Noughts

Introduction

The id for Noughts is "noughts". This is the name that is returned from the GET games request, and it used in all urls to replace the {game} parameter.

There are no game-specific requests for Noughts.

Environment

The environment contains a single value under the key "grid" which is a string in which each character represents a cell. Character 0 represents cell 0, and so on. "." represents an empty cell, "0" represents a mark by player 0 and "1" represents a mark by player 1. All other characters are invalid. The string will be exactly 9 characters long.

{
    "grid" : "........."
}

The environment is always as above, there is no player-specific redaction.

Turn

The turn object should have a single value for the key "cell". The value should be between 0-8 inclusive referring to one of the cells, such that the "lines" are (0, 1, 2), (3, 4, 5), (6, 7, 8), (0, 3, 6), (1, 4, 7), (2, 5, 8), (0, 4, 8) and (2, 4, 6).

{
    "cell" : 0
}

See the games page for details on making the request.

400 Bad Request with error code noughts.cell_not_empty if the cell specified already contains a mark.

If successful, the current player will swap, the environment will be updated, and an event will be fired. 204 No Content is returned.

Events

Whenever a player makes a successful move, an event is fired of the form:

{
    "player" : 1,
    "cell" : 0
}