Skip to content Search Apps Documentation Source Content Run Reset Eval Playground File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

v1 state

Back to all declarations

outLose

untyped bigint

// player loses

Value

(0 <untyped> bigint)

outDraw

untyped bigint

Outcomes.

Value

(1 <untyped> bigint)

outWin

untyped bigint

// player wins

Value

(2 <untyped> bigint)

tally

type

tally holds a single player's cumulative record.

Value

v1.tally

round

type

round is one recorded game (for the recent-rounds table).

Value

v1.round

rounds

[]v1.round

// append-only history; Render shows the tail

Value

<zero>

totalWins

int

// player wins

Value

0

totalLosses

int

// player losses

Value

0

totalDraws

int

State.

Value

0

totalRounds

int

State.

Value

0

maxRecent

untyped bigint

Value

(8 <untyped> bigint)

houseMove

func(height int64, playCount int) v0.Move

houseMove derives the house move deterministically from the chain height and the caller's play count (so repeated calls in the same block differ).

Open
OID
09e26d…28f2:11
houseMove details

Inspect func

decide

func(playerMove v0.Move, houseM v0.Move) int

decide returns the outcome from the player's perspective.

Open
OID
09e26d…28f2:13
decide details

Inspect func

getTally

func(key string) *v1.tally
Open
OID
09e26d…28f2:14
getTally details

Inspect func

Play

func(choice string)

Play plays one round against the chain. choice is "rock"|"paper"|"scissors" (single-letter shortcuts accepted). It panics on an invalid choice.

Open
OID
09e26d…28f2:15
Play details

Inspect func

outcomeName

func(o int) string
Open
OID
09e26d…28f2:16
outcomeName details

Inspect func

winRate

func(wins int, plays int) string
Open
OID
09e26d…28f2:17
winRate details

Inspect func

Render

func(path string) string

Render returns a Markdown dashboard: global tally, per-player table, and the last few rounds. It is caller-agnostic (no cur).

Open
OID
09e26d…28f2:18
Render details

Inspect func
outLose : untyped bigint =(0 <untyped> bigint)
outDraw : untyped bigint =(1 <untyped> bigint)
outWin : untyped bigint =(2 <untyped> bigint)
tally : type =v1.tally
round : type =v1.round
players : *v0.Tree Inspect
rounds : []v1.round =<zero>
totalWins : int =0
totalLosses : int =0
totalDraws : int =0
totalRounds : int =0
maxRecent : untyped bigint =(8 <untyped> bigint)
houseMove : func(height int64, playCount int) v0.Move Inspect
decide : func(playerMove v0.Move, houseM v0.Move) int Inspect
getTally : func(key string) *v1.tally Inspect
Play : func(choice string) Inspect
outcomeName : func(o int) string Inspect
winRate : func(wins int, plays int) string Inspect
Render : func(path string) string Inspect