Skip to content Search Apps Documentation Source Content 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

shake

type

Value

v1.shake

history

[]v1.shake

Value

<zero>

answerIndex

func(height int64, n int) int

answerIndex maps (block height, prior shakes) to an answer slot. Pure and deterministic so it can be tested without touching realm state.

Open
OID
0da37b…cce9:6
answerIndex details

Inspect func

Ask

func(question string) string

Ask poses a question to the Magic 8-Ball and returns its answer. Crossing function: it mutates persistent state, so it takes \`cur realm\` (gno 0.9).

Open
OID
0da37b…cce9:8
Ask details

Inspect func

Asked

func() int

Asked returns how many questions have been asked. Read-only.

Open
OID
0da37b…cce9:9
Asked details

Inspect func

Render

func(path string) string

Render is the gnoweb Markdown view.

Open
OID
0da37b…cce9:10
Render details

Inspect func
answers : []string (len=20) Inspect
shake : type =v1.shake
history : []v1.shake =<zero>
answerIndex : func(height int64, n int) int Inspect
Ask : func(question string) string Inspect
Asked : func() int Inspect
Render : func(path string) string Inspect