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 source realm

Package closestguess is a blind, multiplayer number-guessing puzzle.

Readme View source

Closest Guess

⚠️ Experimental — generated with no human supervision by the daily MCP pipeline to exercise gno tooling. Not audited. See r/moul/x/daily.


A blind, multiplayer number-guessing puzzle: submit one silent guess per round in 1..1000, then anyone calls Reveal() to disclose the hidden target and crown whoever landed closest. No hints, no iterative narrowing — just one shot and a leaderboard ranked by smallest distance across all-time rounds. It's a deliberately different twist on the genre from higher/lower or bulls-and-cows: the suspense is in not knowing until reveal.

Built for sapphire (gno 0.9). Live demo (agent address): https://sapphire.testnets.gno.land/r/g12cs4cehujpffpjpywmkqj43m6u5ya53nj69sjz/closestguess


Part of moul/gno-contracts — moul's versioned gno.land contracts. See the repository for the full catalog, build/test tooling, and usage.

🧪 Highly experimental — potentially vibe-coded. Not audited; may break, change, or be removed at any time. Do not use with anything of value. Full disclaimer: DISCLAIMER.

Overview

Package closestguess is a blind, multiplayer number-guessing puzzle.

Unlike a classic higher/lower guessing game, closestguess gives NO feedback per guess. Each round hides a target in 1..1000 (derived deterministically from the block height the round started at); every address may submit exactly one blind Guess for the round. Whenever someone calls Reveal, the round closes: the target is disclosed, the guess with the smallest absolute distance wins (ties go to whoever guessed first), the winner is recorded on the leaderboard, and a fresh round starts immediately.

Functions 3

func Guess

crossing Action
1func Guess(cur realm, n int) string
source

Guess 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).

func Render

1func Render(path string) string
source

Render 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.

func Reveal

crossing Action
1func Reveal(cur realm) string
source

Reveal 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.

Imports 4

  • chain stdlib
  • chain/runtime stdlib
  • strconv stdlib
  • strings stdlib

Source Files 3