Search Apps Documentation Source Content File Folder Download Copy Actions Download

wordle package

Overview

Package wordle is a daily five-letter word puzzle realm for gno.land.

The day's secret word is picked deterministically from the current block height (a "day index"), so every player faces the same word for the same span of blocks. Players submit guesses with Guess; each guess is scored letter-by-letter with emoji feedback (🟩 correct spot, 🟨 wrong spot, ⬜ absent). Render shows the caller's board, attempts left, and rules.

Functions

Guess

func Guess(cur realm, word string)

Guess records a five-letter guess for the caller against today's word.

It is a crossing (state-mutating) function: callers invoke it as Guess(cross(cur), "crane"). Identity is taken from the live crossing frame after the IsCurrent authentication check.

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/g12cs4cehujpffpjpywmkqj43m6u5ya53nj69sjz/wordle" -func "Guess" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "test-13" -remote "https://rpc.test13.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test13.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g12cs4cehujpffpjpywmkqj43m6u5ya53nj69sjz/wordle" -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 "test-13" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test13.testnets.gno.land" call.tx
  

Render

func Render(path string) string

Render returns the caller's board as Markdown. It is NOT a crossing function (no cur realm parameter). It reads the viewer via the stack-walking unsafe.PreviousRealm(); an unknown viewer simply sees an empty board.

Param

Command

gnokey query vm/qeval -remote "https://rpc.test13.testnets.gno.land" -data "gno.land/r/g12cs4cehujpffpjpywmkqj43m6u5ya53nj69sjz/wordle.Render()"

Result