Skip to content Search Apps Documentation Source Content File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

memory/v0 package

Overview

Package memory implements "Memory Match", a concentration game on a 4x4 grid of 8 emoji pairs. The board is shuffled deterministically from the current block height (no on-chain RNG exists), so a NewGame started at a given height always produces the same layout.

Functions

Flip

func Flip(cur realm, index int)
Ask AI Claude ChatGPT

Flip reveals the tile at index (0..15).

Rules:

  • If two tiles are already showing from a previous unmatched attempt, this Flip first clears them (they turn back to hidden), then reveals the requested tile as the first of a new attempt.
  • Revealing the second tile of an attempt completes a move: matching faces stay face-up (matched); a mismatch leaves both showing until the next Flip clears them.
  • Flipping an already-matched or already-showing tile is rejected.

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/nym-moultest123/x/daily/memory/v0" -func "Flip" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/nym-moultest123/x/daily/memory/v0" -func "Flip" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx
  

NewGame

func NewGame(cur realm)
Ask AI Claude ChatGPT

NewGame reshuffles the board using the current block height as the seed.

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/nym-moultest123/x/daily/memory/v0" -func "NewGame" -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/nym-moultest123/x/daily/memory/v0" -func "NewGame" -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx
  

Render

func Render(path string) string
Ask AI Claude ChatGPT

Render draws the board as Markdown: a 4x4 grid, move count and solved state.

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/nym-moultest123/x/daily/memory/v0.Render()"

Result