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

scores

[]int64 (len=8)

scores is the worked example: eight slots, small enough to check by hand.

Open
OID
084eb0…71f2:4
scores details (len=8)

+8 more Inspect slice

holders

[]string (len=5)

stakes is the weighted-draw example. The zero is the interesting entry: a holder with no stake must never be drawn, and that is a property of the search, not of the caller remembering to skip them.

Open
OID
084eb0…71f2:6
holders details (len=5)

+5 more Inspect slice

stakes

[]int64 (len=5)

stakes is the weighted-draw example. The zero is the interesting entry: a holder with no stake must never be drawn, and that is a property of the search, not of the caller remembering to skip them.

Open
OID
084eb0…71f2:8
stakes details (len=5)

+5 more Inspect slice

Render

func(path string) string

Render renders the demo for gnoweb. Render("") / Render("/") -> the full demo

Open
OID
084eb0…71f2:9
Render details

Inspect func

joinInts

func(vals []int64) string

joinInts formats a slice for display. Written out rather than reached for from a library because there is no sensible shared home for it yet.

Open
OID
084eb0…71f2:11
joinInts details

Inspect func

pct

func(part int64, whole int64) string

pct renders part/whole as a whole-number percentage. Integer arithmetic throughout: Render output has to be byte-identical on every validating node, and floating point is the usual way that stops being true.

Open
OID
084eb0…71f2:12
pct details

Inspect func
scores : []int64 (len=8) Inspect
holders : []string (len=5) Inspect
stakes : []int64 (len=5) Inspect
Render : func(path string) string Inspect
joinInts : func(vals []int64) string Inspect
pct : func(part int64, whole int64) string Inspect