zero
.uverse.addressValue
<zero>
board
[9]string// "" empty, "X", "O"
- OID
- 072ee6…fc4d:5
board details
playerX
.uverse.addressValue
<gnolang.StringValue>
playerO
.uverse.addressValue
<zero>
turn
string// "X" or "O", whose move is next
Value
"X"
winner
string// "", "X", "O", or "Draw"
Value
""
moves
intValue
0
init.7
func()- OID
- 072ee6…fc4d:11
init.7 details
Join
func() stringJoin seats the caller as X (if the seat is open) or O (if X is taken). Panics if both seats are already filled.
- OID
- 072ee6…fc4d:13
Join details
Move
func(pos int)Move places the caller's mark at the given cell (0-8) if it is their turn and the cell is empty, then checks for a win or a draw.
- OID
- 072ee6…fc4d:14
Move details
Reset
func()Reset clears the board for a new game. Only callable once the current game has ended (someone won or the board is full).
- OID
- 072ee6…fc4d:15
Reset details
winLines
[8][3]int- OID
- 072ee6…fc4d:17
winLines details
checkWin
func(mark string) bool- OID
- 072ee6…fc4d:26
checkWin details
cell
func(pos int) string- OID
- 072ee6…fc4d:27
cell details
Render
func(path string) stringRender draws the current board and game status as markdown.
- OID
- 072ee6…fc4d:28
Render details
zero
:
.uverse.address
=<zero>
board : [9]string Inspect
playerX
:
.uverse.address
=<gnolang.StringValue>
playerO
:
.uverse.address
=<zero>
turn
:
string
="X"
winner
:
string
=""
moves
:
int
=0