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 kingofdice is a "king of the hill" dice game. Anyone can Roll a pseudo-random 1-100 die; beat the reigning ki...

Readme View source

👑 King of the Dice

⚠️ Experimental — generated with no human supervision. This realm was produced automatically by an MCP-driven agent to exercise the gno MCP server and tooling, and to generate test content for gno compilers, linters and formatters. Not audited. Not for production. Full context & folder README: r/moul/x/daily


A "king of the hill" dice game for gno.land (sapphire / gno 0.9). Call Roll() to throw a deterministic 1-100 die; beat the reigning king's roll and you dethrone them, becoming king yourself. Unlike a typical leaderboard that just sums points, this one ranks players by accumulated reign length in blocks — a single lucky high roll only pays off for as long as nobody beats it, so outlasting the field matters more than the roll itself.

Realm path: gno.land/r/g12cs4cehujpffpjpywmkqj43m6u5ya53nj69sjz/kingofdice

Public API

Function Kind Description
Roll(cur realm) crossing (tx) Roll 1-100; dethrones the king on a higher roll.
Render(path string) string view Current king + reign-length leaderboard.

Example calls

1gnokey maketx call \
2  -pkgpath "gno.land/r/g12cs4cehujpffpjpywmkqj43m6u5ya53nj69sjz/kingofdice" \
3  -func Roll \
4  -gas-fee 1000000ugnot -gas-wanted 2000000 \
5  -broadcast -chainid sapphire-1 -remote <rpc> <keyname>

View the dashboard in gnoweb at /r/g12cs4cehujpffpjpywmkqj43m6u5ya53nj69sjz/kingofdice, or query it:

1gnokey query "vm/qrender" -data "gno.land/r/g12cs4cehujpffpjpywmkqj43m6u5ya53nj69sjz/kingofdice:" -remote <rpc>

Toolchain status

Verified locally: gno test . passes (built against a gnolang/gno checkout as GNOROOT, since the machine's configured GNOROOT pointed at a stale, deleted path). Tests avoid gno.land/p/nt/uassert/v0 — the cached copy of that package uses the bare cross builtin as a function value, which the locally installed gno (master) rejects; plain testing.T calls sidestep that unrelated cache/toolchain drift.


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

Dependency graph:

gno.land/r/moul/x/daily/kingofdice/v0 dependency graph

🧪 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 kingofdice is a "king of the hill" dice game. Anyone can Roll a pseudo-random 1-100 die; beat the reigning king's roll and you dethrone them, becoming king yourself. The leaderboard doesn't rank raw points — it ranks accumulated *reign length*, measured in blocks held as king, so camping on a lucky high roll pays off more than a single spike.

Functions 2

func Render

1func Render(path string) string
source

Render shows the current king and a reign-length leaderboard.

func Roll

crossing Action
1func Roll(cur realm) string
source

Roll throws the die for the caller. Rolling higher than the current king's roll dethrones them (crediting their finished reign in blocks) and crowns the caller as the new king.

Imports 4

Source Files 3