tttm is a game of tic-tac-toe played between APIs that players implement themselves.
- Players can use whatever language and whatever technology.
- The player must submit the URL to a server via the PR request on this repository. All player servers are listed in players.yml.
- The player can submit as many servers as he or she wants.
- The server needs to follow the Player Server Protocol described in this document.
- The game server will randomly pick player servers and execute gameplay.
- Games will be played every hour. Each server will play 100 games every hour.
- The server needs to respond in 3 seconds. Otherwise, the opposing server wins.
TBD: Scoring
Players need to implement an HTTP server that needs to have one endpoint.
The game server will pass the following URL query parameters
to the player server.
gid
-UUID
that represents the given game ID.- It can be used on player servers to stick together individual games.
size
- A number - size - of tic-tac-toe grid. By default, set to3
playing
- A symbol that the player server needs to play. Possible values areX
orO
moves
- A string that represents the previous moves.- Moves are separated by
-
and positions by_
- Example:
X_1_1-O_0_0
means that theX
symbol was at location1,1
(centre of grid) andO
at0,0
(top-left corner of the grid)
- Moves are separated by
The content of the successful response (HTTP status 200) needs to be a string that should have the following structure:
Move:X_2_2
The player server replied by placing the symbol X
in position 2,2
in the grid—in this case, the very bottom right.
If, for some reason, the server is unable to reply or parse, please use the following payload structure:
Error:Sorry. Can't do it bro.
- tttm-randy is a sample player server implemented in Python 3 with Flask and uses "random strategy" where it will "play" any field that is empty on the given grid.
Why not? We want to see who can build the universe's fastest and most "intelligent" APIs for the lolz.