rt3: rt3: A Package for Playing Tic-Tac-Toe in R.

Description Main Function Structures Constants Support Functions Built-In Player Functions References


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.

Main Function

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.

Support Functions

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

Built-In Player Functions

randomMovePlayer A player that plays random valid moves

firstAvailableMovePlayer A player that always plays the first move available



rt3 documentation built on May 2, 2019, 6:38 a.m.

Related to rt3 in rt3...