Tic-Tac-Toe
Game logic
Game state schema
message State {
// Required field to indicate the player who should be making the next move
// Values = 0 or 1
int32 player_turn_idx = 1;
/*
Array of size 9 initialized to -1, representing an empty 3 by 3 board.
The values of board can be -1, 0, or 1.
Placing a piece in index x will set the value of board[x] to the player's index.
Array is row major order: index 0 is top left, index 2 is top right, index 6 is
bottom left, and index 8 is bottom right.
*/
repeated int32 board = 2;
}
Action schema
place_piece(int index)
Last updated
Was this helpful?