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

hangman/v0 package

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.

Function

Guess

func Guess(cur realm, letter string)

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.

Param

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/moul/x/daily/hangman/v0" -func "Guess" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "gnoland-1" -remote "https://rpc.gno.land" ADDRESSgnokey query -remote "https://rpc.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/moul/x/daily/hangman/v0" -func "Guess" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "gnoland-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.gno.land" call.tx