minTarget
untyped bigintValue
(1 <untyped> bigint)
maxTarget
untyped bigintValue
(1000 <untyped> bigint)
roundT
typeroundT holds the mutable state of the open round. The target stays hidden (never rendered, never returned) until Reveal closes the round.
Value
v0.roundT
winRecord
typewinRecord is one closed-round result, kept for the leaderboard.
Value
v0.winRecord
guessEntry
typeguessEntry is one address's blind guess for the current round.
Value
v0.guessEntry
current
*v0.roundT- OID
- 05a769…3183:19
current details
entries
[]v0.guessEntryValue
<zero>
leaderboard
[]v0.winRecordValue
<zero>
init.8
func()- OID
- 05a769…3183:6
init.8 details
newRound
func(number int, height int64) *v0.roundTnewRound builds a fresh round whose hidden target derives deterministically from the start height and round number. Gno has no runtime RNG, so mixing height with the round number is the only available entropy, and it also keeps consecutive rounds at the same height from repeating a target.
- OID
- 05a769…3183:8
newRound details
targetFromHeight
func(h int64, round int) int- OID
- 05a769…3183:9
targetFromHeight details
Guess
func(n int) stringGuess records the caller's single blind guess for the current round. It returns no hint about correctness — that is the whole point of the puzzle. Crossing function: caller invokes as Guess(cross(cur), n).
- OID
- 05a769…3183:10
Guess details
hasGuessed
func(addr string) bool- OID
- 05a769…3183:11
hasGuessed details
Reveal
func() stringReveal closes the current round: discloses the target, crowns whoever landed closest (ties favor the earliest guesser), records a leaderboard entry, and opens a fresh round. Panics if nobody has guessed yet. Crossing function.
- OID
- 05a769…3183:12
Reveal details
distance
func(guess int, target int) int- OID
- 05a769…3183:13
distance details
Render
func(path string) stringRender produces the gnoweb Markdown view. The current round's target and individual guess values are never shown — only the player count — so rendering the page can't leak the puzzle.
- OID
- 05a769…3183:14
Render details
renderLeaderboard
func() stringrenderLeaderboard formats closed rounds ranked by smallest distance (ties: earlier round first). Sorted on a copy so state is untouched.
- OID
- 05a769…3183:15
renderLeaderboard details
sortByClosest
func(rs []v0.winRecord)sortByClosest does an in-place insertion sort: smallest distance first, then earlier round first on ties. Small n; insertion sort keeps it deterministic and dependency-free.
- OID
- 05a769…3183:16
sortByClosest details
closer
func(a v0.winRecord, b v0.winRecord) bool- OID
- 05a769…3183:17
closer details
shortAddr
func(a string) string- OID
- 05a769…3183:18