Triple Town Player Protocol
1 Variant
2 Move

Triple Town Player Protocol

A Triple Town player is implemented as a server that accepts HTTP requests containing a payload (if any) in XML format and that responds with in XML format. There are two kinds of queries to the server:

The queries can be interleaved, and successive Move queries may or may not correspond to a single game. In particular, the server may be used for multiple games at a time.

1 Variant

A player is initially queried with GET at the URL /variant. The server must respond with a <variant> element whose value attribute is either "basic" or "extended".

For example, a player that supports only the basic game could respond with

  <variant value="basic"/>

2 Move

To let a player make a move, the player is queried with POST at the URL /move. The content of the request is the current game state, which is supplied as XML containing a <game> element.

The <game> element contains three elements (in order):

  1. A <board> element.

    The <board> element which contains six <row> elements.

    The first <row> element contains five <cell> elements, while each of the remaining five <row> elements contains six <cell> elements.

    Each <cell> element has a tile attribute whose value is one of the following:

    • "blank"

    • "grass"

    • "bush"

    • "tree"

    • "hut"

    • "house"

    • "mansion"

    • "castle"

    • "floating-castle"

    • "triple-castle"

    • (Extended game) "bear"

    • (Extended game) "ninja-bear"

    • (Extended game) "tombstone"

    • (Extended game) "church"

    • (Extended game) "cathedral"

    • (Extended game) "chest"

    • (Extended game) "large-chest"

    • (Extended game) "rock"

    • (Extended game) "mountain"

  2. A <current> element.

    The <current> element has a tile attribute whose value is one of the following:

    • "grass"

    • "bush"

    • "tree"

    • "hut"

    • "crystal"

    • "imperial-bot"

    • (Extended game) "bear"

    • (Extended game) "ninja-bear"

  3. A <storehouse> element.

    The <storehouse> element has a tile attribute whose value is like the <current> element, except that the tile attribute value can also be "none".

The player’s response must be an XML document of one the following forms: