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

eightball state

Back to all declarations

shake

type

Value

eightball.shake

history

[]eightball.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
086950…181d: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
086950…181d:8
Ask details

Inspect func

Asked

func() int

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

Open
OID
086950…181d:9
Asked details

Inspect func

Render

func(path string) string

Render is the gnoweb Markdown view.

Open
OID
086950…181d:10
Render details

Inspect func

shortAddr

func(a string) string
Open
OID
086950…181d:11
shortAddr details

Inspect func
answers : []string (len=20) Inspect
shake : type =eightball.shake
history : []eightball.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
shortAddr : func(a string) string Inspect