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 hangman is a classic hangman game for gno.land.

Readme View source

🪢 Hangman

⚠️ 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


Classic hangman as a gno.land realm. A secret word is chosen deterministically per day from a built-in list using the current block height (runtime.ChainHeight()), so everyone hitting the realm on the same day plays the same shared game: guessed letters and the wrong-count are common state. Guess a letter to reveal every matching position, or lose one of six lives — solve the word before the gallows fills up.

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

Example calls

1# Guess a letter (tx — mutates the shared daily game)
2gnokey maketx call -pkgpath "gno.land/r/REPLACE_ADDR/hangman" \
3  -func Guess -args "e" -gas-fee 1000000ugnot -gas-wanted 2000000 \
4  -broadcast -chainid sapphire-1 KEY
5
6# View the current board (masked word, guesses, gallows, status)
7gnokey query "vm/qrender" -data "gno.land/r/REPLACE_ADDR/hangman:"

Rules

  • Each Guess(cur, letter) takes a single letter az (case-insensitive).
  • A hit reveals all matching positions; a miss increments the wrong-count.
  • Six wrong guesses = game over. Guessing every letter = win.
  • Re-guessing an already-tried letter, or playing after the game is over, aborts.
  • The word rotates roughly every day (a fixed span of blocks).

Render returns Markdown showing the ASCII gallows stage for the current wrong-count, the masked word (_ for hidden letters), the sorted list of guessed letters, the lives remaining, and the win/lose/in-progress status.


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/hangman/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 hangman is a classic hangman game for gno.land.

The secret word rotates every ~"day" (a fixed span of blocks) and is chosen deterministically from a built-in word list using runtime.ChainHeight(). All players share a single game per day: guesses and the wrong-count are common state. Guess a letter to reveal every matching position, or lose a life. Six wrong guesses ends the game.

Functions 2

func Guess

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

Guess submits a single letter for the current day's shared game. It reveals matching letters or costs a life. Aborts on bad input or when the game is already over.

func Render

1func Render(path string) string
source

Render shows the current day's game: gallows, masked word, guesses, status.

Imports 4

Source Files 3