The rt3 package provides functions to allow a user to simulate tic-tac-toe games. It provides a convenient gameState object as well as simple interface for developing new types of players.
playGame Play a game of tic-tac-toe.
gameState A tic-tac-toe game state.
X The X player.
O The O player.
EMPTY The EMPTY constant. Used to indicate an empty board position.
NONE The NONE constant. Used to indicate a draw.
These functions are used by the playGame function.The will also be usefull in building game decsion trees for more complex players.
startGame Create a new tic-tac-toe game state.
getMoves Get the current set of valid moves for a given game state
makeMove Apply a move to the given game state and return the resulting game state
randomMovePlayer A player that plays random valid moves
firstAvailableMovePlayer A player that always plays the first move available
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.