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

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.

Function

Flip

func Flip(cur realm, index int)

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/moul/x/daily/memory/v0" -func "Flip" -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/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 "gnoland-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.gno.land" call.tx