The TTTM Challenge: The machine-to-machine challenge of tic-tac-toe 🕹️
The tttm is a game of tic-tac-toe played between APIs that players implement themselves.
Rules
- Players can use any language and any technology.
- The player can submit as many servers as he or she wants.
- The player must submit the URL to a server via the PR request to the tttm repository -
players.yml. - The player server needs to follow the Player Server Protocol described in this document.
- The player server needs to respond in 2 seconds. Otherwise, the opposing server wins the game.
- All players and their servers are listed in players.yml.
Notes
- ⚠️ As the platform and systems are still in heavy development scoring and rankings is still subject to change.
- The tttm is a open-source game engine that actually executes all the matches.
Player Server Protocol
The players need to implement an HTTP server that needs to have one endpoint.
The GET /move request
The game server will pass the following URL query parameters to the player server.
gid-UUIDthat represents the given game ID.size- The size of tic-tac-toe grid.- By default, the size is set to
3, representing the grid of size3x3. - Possible sizes are
3,5and7. - On grids with size
5or7- four symbols are needed for a win.
- By default, the size is set to
playing- A symbol that the player server needs to play.- Possible values are
XorO.
- Possible values are
moves- A string that represents the previous moves.- Moves are separated by
_and positions by-. - Example:
X-1-1_O-0-0means that theXsymbol was at location1,1(centre of grid) andOat0,0(top-left corner of the grid).
- Moves are separated by
Body
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.
Example Player Servers
- 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?
Why not? We want to see who can build the universe’s fastest and most “intelligent” APIs for the lolz.