Members
gameOver :Boolean
If the game is over
Type:
- Boolean
Methods
checkGameOver() → {number|string|null}
Checks if the game is over (tie, win by row, by column or by diagonal).
Returns "tie" if there's a tie, the winner or null if the game can continue.
Returns:
- Type
- number | string | null
makeMove(player, cell, check)
Makes a move on the board.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
player |
number | The player that moves. 0 means O and 1 means X | |
cell |
number | The cell, cells are numbered from 1-9. | |
check |
Boolean | true | Check at the end of the turn if the game is over (recommended and by default). If not true, then you should check it manually via checkGameOver() at the end of the turn: |