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

Readme View source

Collatz Explorer

⚠️ 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 hailstone-sequence explorer realm. Call Compute(n) to walk the Collatz sequence for a positive integer n — the realm records its stopping time (number of steps to reach 1) and peak value, attributed to your address. The root page shows a leaderboard of the longest sequences submitted, and /<n> renders the full hailstone sequence for any n on the fly.

Realm path: gno.land/r/REPLACE_ADDR/collatz

Example calls

# record a run for n = 27 (111 steps, peak 9232)
gnokey maketx call -pkgpath "gno.land/r/REPLACE_ADDR/collatz" \
  -func Compute -args 27 ...

# view the leaderboard
gnokey query vm/qrender --data "gno.land/r/REPLACE_ADDR/collatz:"

# view the full hailstone sequence for 27
gnokey query vm/qrender --data "gno.land/r/REPLACE_ADDR/collatz:/27"

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/collatz/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.

Functions 2

func Compute

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

Compute walks the hailstone sequence for n and records the result attributed to the caller. It is a crossing (state-mutating) func.

func Render

1func Render(path string) string
source

Render shows the leaderboard at root, or the full hailstone sequence for a given n at path "/<n>".

Types 1

type Result

struct
1type Result struct {
2	N     int64
3	Steps int
4	Peak  int64
5	Who   address
6}
source

Result is one recorded submission.

Imports 6

Source Files 3