Two players can start a game and play it using REST calls. No authentication is performed.
Start the server.
$ go run .Make HTTP requests to start a game.
$ curl http://localhost:8080/connectfour/new && echo{"id":1,"nextPlayer":1,"winner":0,"board":[[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]]}Place a piece on the board (columns start at zero).
$ curl http://localhost:8080/connectfour/1 -X POST -d "player=1&column=0" && echo{"id":1,"nextPlayer":2,"winner":0,"board":[[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[1,0,0,0,0,0,0]]}Obtain the current state of a game.
$ curl http://localhost:8080/connectfour/1 && echo{"id":1,"nextPlayer":2,"winner":0,"board":[[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[1,0,0,0,0,0,0]]}