Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

tictactoe state

Back to all declarations

empty

uint8

Value

0

markX

uint8

Value

1

markO

uint8

Value

2

turn

uint8

Value

2

playerX

.uverse.address

Value

<gnolang.StringValue>

playerO

.uverse.address

Value

<zero>

winner

uint8

Value

0

moveCount

int

Value

1

gameOver

bool

Value

false

zeroAddr

.uverse.address

Value

<zero>

Join

func(mark string)

Join claims the X or O mark for the calling account. Each mark may only be claimed once per game; call Reset to start a new game.

Open
OID
024a44…01ba:12
Join details

Inspect func

Play

func(pos int)

Play places the calling player's mark at pos (0-8, row-major).

Open
OID
024a44…01ba:14
Play details

Inspect func

Reset

func()

Reset clears the board and both player slots. Only a current player may reset, and only after the game has ended.

Open
OID
024a44…01ba:15
Reset details

Inspect func

markString

func(m uint8) string
Open
OID
024a44…01ba:27
markString details

Inspect func

Render

func(string) string

Render draws the current board and game status as markdown.

Open
OID
024a44…01ba:28
Render details

Inspect func
empty : uint8 =0
markX : uint8 =1
markO : uint8 =2
board : [9]uint8 Inspect
turn : uint8 =2
playerX : .uverse.address =<gnolang.StringValue>
playerO : .uverse.address =<zero>
winner : uint8 =0
moveCount : int =1
gameOver : bool =false
zeroAddr : .uverse.address =<zero>
Join : func(mark string) Inspect
Play : func(pos int) Inspect
Reset : func() Inspect
winLines : [8][3]int Inspect
checkWinner : func() uint8 Inspect
markString : func(m uint8) string Inspect
Render : func(string) string Inspect