tic.tac.toe: Main game

Description Usage Arguments Value Examples

Description

Main game

Usage

1
tic.tac.toe(ttt, player1 = "human", player2 = "computer")

Arguments

ttt:

data.tree: the full list of moves for every game.

player1:

String: the optional name of player1.

player2:

String: the optional name of player2.

game:

vector of length 9

ttt:

data.tree: the full list of moves for every game.

player1:

String: the optional name of player1.

player2:

String: the optional name of player2.

node:

data.tree: the full list of moves for every game.

label:

String: the optional description of which node this represents

Value

an integer: 0: no one has one 1: player 1 has won -1: player -1 has won

an integer: 0: no one has one 1: player 1 has won -1: player -1 has won

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
ttt <- TTTTree()
tic.tac.toe(ttt)

Draw the game board - using plots

ttt <- TTTTree()
draw.board(rep(1:9))

Main game

ttt <- TTTTree()
tic.tac.toe(ttt)

print a node in the tree.

PrintNode(node)
tic.tac.toe(ttt, label='child')

pkristoff/TicTacToeImpls documentation built on May 19, 2019, 1:47 a.m.