- upon start, server waits for the two players to connect.
- More than two players can't connect in that server, however, limit is configurable.
- If one of the players disconnects, the game is over and all players will be removed.
- More that 1 game can't be started, however, limit is configurable.
- Server will decide the color of a corresponding player (PLAYER_O or PLAYER_X). Default color of the board is (NONE).
- For each turn, server will check if a player is won or game is tied.
Register Player:
curl -H "Content-Type: application/json" -X POST http://localhost:8080/game/register/player -d '{"name":"Mahedi"}'
curl -H "Content-Type: application/json" -X POST http://localhost:8080/game/register/player -d '{"name":"John"}'
Get Game state and player to next turn:
curl -X GET http://localhost:8080/game/board/state
In response: There are three possible status can be found.
INITIALIZED: means the game has been started
FINISHED: means the game is finished succesfully and someone has won.
TIED: means the game is finished with tie.
Play next move:
curl -X GET http://localhost:8080/game/player/<playerId>/next-move/<columnToMove>
curl -X GET http://localhost:8080/game/player/1/next-move/8
Disconnect Player:
curl -X DELETE http://localhost:8080/game/player/<playerId>/disconnect
curl -X DELETE http://localhost:8080/game/player/1/disconnect
- java 8+
- mvn 3.6+
mvn clean test
mvn spring-boot:run
mvn test
cat target/site/jacoco/index.html
server: http://localhost:8080
Please use this client for playing the game.
- Add more Unit test
- Add Integration test
- Improve java docs
- Improve design
- Add more feature.