Repository navigation
Home
Alejandro U. Alvarez edited this page Apr 11, 2017
·
11 revisions
In order to write a player that can be executed by uabc, you will need to:
- Listen for some input on
STDIN(e.g. the server starting the game, the opponent making a move) - Record the state of that move (so you have a representation of the board)
- Respond with output on
STDOUT(e.g. your move)
The uabc client will send you one of the following:
| Command | Description |
|---|---|
init |
The server is telling you to start the game - choose any board and move that you want |
move |
Move request, since you can answer directly to an opponent move, this is usually not necessary |
opponent x,y;x,y |
Sent after an opponent move, it contains their move data in the form board.x, board.y; move.x, move.y. After receiving this you can directly answer with your move |
The only possible response at any given time is a move. If you answer out of place you will lose the game.
x,y;x,y - Where the first coordinates are the board, and the second are the move (board.x, board.y; move.x, move.y)
The following is a sample game from the point of view of player 1: