This API lets you play Tic-Tac-Toe on 3x3 game board with a friend. It also supports multiple simultaneous games. It's written in Java 8 with the help of Spring Boot
- The game is played on a 3x3 grid.
- Players alternate to place their mark on an unoccupied space on the grid.
- The objective is to get three of their marks in a row.
- The first player uses X the second player uses O.
- Play continues until a player gets three of their marks in a row (horizontally or diagonally) or there are no free spaces left on the grid.
Note: To see the HTML version of the spec, please look at api-specification.html and see you see the RAML version, please look at src/main/resources/api-specification/application.raml
Start a new Game with an empty 3x3 board
Name | Type | Description | Required | Examples |
---|---|---|---|---|
Location | string | Resource path to the new Game | true | /game/{gameId} |
- Game ID: An identifier which uniquely identifies a Game
-
Type: string
-
Required: true
-
Use this resource if you want to know the current state of the Game
{
"state": "IN_PROGRESS"
}
{
"errors": [
{
"code": "GAME_NOT_FOUND",
"message": "Game not found"
}
]
}
-
Game ID: An identifier which uniquely identifies a Game
-
Type: string
-
Required: true
-
-
symbol:
-
Type: string
-
Required: true
-
Use this resource to place the given symbol on the Game board
{
"location": {
"row": 1, "column": 1
}
}
{
"errors": [
{
"code": "INVALID_VALUE",
"message": "Row is invalid",
"path": "/row"
}
]
}
{
"errors": [
{
"code": "GAME_OVER",
"message": "Game is over"
}
]
}
{
"errors": [
{
"code": "GAME_NOT_FOUND",
"message": "Game not found"
}
]
}
{
"errors": [
{
"code": "OCCUPIED_LOCATION",
"message": "Location is already occupied by another player"
}
]
}