Description Usage Arguments Value Examples
figures out which was the first pick in the UI and that is the humanSide.
shiny server
1 2 3 |
board: |
3x3 matrix |
index: |
Integer (1:9) |
winner: |
Integer: who won the current game localBoard: 3x3 matrix |
input: |
shiny input |
output: |
shiny output |
session: |
shiny session |
tree: |
tree representing the remaining possible moves for the game |
localBoard: |
Vector 1:9 |
side: |
Integer: 1,-1 |
r: |
Integer: 1:3 |
c: |
Integer: 1:3 |
winner: |
Integer: 1,-1 Who won the name |
localBoard: |
Vector 1:9 |
computerSide: |
Integer: 1,-1 |
tree: |
tree representing the remaining possible moves for the game |
winner: |
Integer: 1,-1 Who won the name |
localBoard: |
Vector 1:9 |
localBoard: |
Vector 1:9 |
tree: |
represting the last move by computer before human move |
Integer: 1,-1,0
list of UI checkbox names.
: Boolean: whether game is over not
List: localBoard, move, childTree
Integer 1:9 location in localBoard.
List localBoard, move, tree for move
Boolean gameOver
child tree
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | Resets for new game.
Converts a board location to a UI cell location.
called if New Game button is called.
If game over then update xWins, OWins, & ties. It
also updates the UI.
reset game
convert row and column to a location in the localBoard.
convert row and column to a location in the localBoard.
compute computer move.
Update wins by X and O. Also, show ties.
Find the child node of the current tree that
the human has made.
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.