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

v0 state

Back to all declarations

history

type

history holds every roll made by a single caller, most recent last.

Value

v0.history

total

int

Value

0

deriveFace

func(height int64, addr string, n int) int

deriveFace turns public entropy into a face in \[1,6]. It is deterministic: the same (height, addr, n) always yields the same face, so any observer can recompute and verify a roll. Uses a simple FNV-1a-style hash over the mixed entropy bytes so different callers at the same height get different faces.

Open
OID
059cf0…77a0:9
deriveFace details

Inspect func

Roll

func() int

Roll performs one dice roll for the calling account and records it. It is a crossing function (gno 0.9 interrealm convention: \`cur realm\` first parameter). Callers invoke it as Roll(cross(cur)). The result is derived deterministically from the current block height, the caller address, and the caller's prior roll count — no stored secret, fully verifiable.

Open
OID
059cf0…77a0:11
Roll details

Inspect func

RollsOf

func(addr string) []int

RollsOf returns the recorded roll history for an address (oldest first). Read-only helper, safe to call as a query.

Open
OID
059cf0…77a0:12
RollsOf details

Inspect func

Total

func() int

Total returns the global roll count.

Open
OID
059cf0…77a0:13
Total details

Inspect func

Distribution

func() [6]int

Distribution returns the global per-face counts, faces 1-6.

Open
OID
059cf0…77a0:14
Distribution details

Inspect func

bar

func(n int, max int, width int) string

bar renders a proportional ▓/░ bar of fixed width for a face's share.

Open
OID
059cf0…77a0:15
bar details

Inspect func

Render

func(path string) string

Render returns the realm's gnoweb Markdown view. Render is NOT a crossing function (no \`cur realm\` param) — it is a read-only query surface. It shows the total roll count, a distribution bar chart for faces 1-6, and the most recent rolls.

Open
OID
059cf0…77a0:16
Render details

Inspect func
history : type =v0.history
count : [6]int Inspect
total : int =0
players : *v0.Tree Inspect
deriveFace : func(height int64, addr string, n int) int Inspect
Roll : func() int Inspect
RollsOf : func(addr string) []int Inspect
Total : func() int Inspect
Distribution : func() [6]int Inspect
bar : func(n int, max int, width int) string Inspect
Render : func(path string) string Inspect