Skip to content Search Apps Documentation Source Content Run Reset Eval Playground 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.

connect4_v2 package

Overview

package connect4_v2 is a staked Connect 4 game. A creator posts an offer with a ugnot stake; anyone (or a named opponent) accepts with the same stake; the winner takes the pot minus a flat house fee.

The first mover is picked by commit-reveal: the creator offers with sha256(passphrase) and must Reveal the passphrase within 90s of Accept, or forfeit. Randomness computed in Accept could be re-rolled by an acceptor who bundles [Accept, Play] in one atomic tx and lets it revert.

Every move has a 90s clock measured in block time. Nothing on-chain fires by itself, so an expired clock is settled by anyone calling ClaimTimeout: an unrevealed game is won by the acceptor, a game whose first mover never moved is void and both stakes are refunded, otherwise the player who ran out of time forfeits.

Function

GameJSON

func GameJSON(id int) string
Ask AI Claude ChatGPT

GameJSON returns {"now":<unix>,"game":<game>|null}. It is a read-only accessor for clients querying over vm/qeval; now is the block time.

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/nym-mikecito001/connect4_v2.GameJSON()"

Result

Gno Expression Evaluator

Evaluate any read-only Gno expression against gno.land/r/nym-mikecito001/connect4_v2, for example a function call with arguments.