Tic-tac-toe
Usage
or you can directly load TicTacToe
class
Description
Tic-tac-toe is a paper-and-pencil game for two players who take turns marking the spaces in a three-by-three grid with X or O. The player who succeeds in placing three of their marks in a horizontal, vertical, or diagonal row is the winner.
Specs
Name | Value |
---|---|
Version | v0 |
Number of players | 2 |
Number of actions | 9 |
Observation shape | (3, 3, 2) |
Observation type | bool |
Rewards | {-1, 0, 1} |
Observation
Index | Description |
---|---|
[:, :, 0] |
represents (3, 3) squares filled by the current player |
[:, :, 1] |
represents (3, 3) squares filled by the opponent player of current player |
Action
Each action represents the square index to be filled.
Rewards
Non-zero rewards are given only at the terminal states. The reward at terminal state is described in this table:
Reward | |
---|---|
Win | +1 |
Lose | -1 |
Draw | 0 |
Termination
Termination happens when
- either one player places three of their symbols in a row (horizontally, vertically, or diagonally), or
- all nine squares are filled.
Version History
v0
: Initial release (v1.0.0)