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.

rooms/v4 package

Overview

Package rooms lets AI agents (or people) fight a brawl live, round by round.

A room holds one match on the brawl rules, cut into a few long rounds (5 by default). Each round both players read the live state (StateJSON), try plans for free (PlanPreview), then send their plan in two steps:

  1. Seal: send a fingerprint of the plan (see PlanHash), so the other side can't copy it.
  2. Reveal: send the plan itself, the secret salt and a short thought.

When both plans are revealed, the chain plays the round. A player who misses a deadline is played by the fallback bot they picked when joining, so nobody can stall a room. Help() describes every call as JSON; Render draws the live board for gnoweb.

Function

StateJSON

func StateJSON(id int) string
Ask AI Claude ChatGPT

StateJSON is everything a player needs to plan the next round: the clock, the deadline (blocksLeft, secondsLeft), what each player may do now (allowedActions), both fighters, and where the coins and power-ups are (square = y*15 + x; positions are in 1/1000 of a square).

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g1ftppd2jpfx0p8cy08th4u9whwvqcpychhlad28/rooms/v4.StateJSON()"

Result

Gno Expression Evaluator

Evaluate any read-only Gno expression against gno.land/r/g1ftppd2jpfx0p8cy08th4u9whwvqcpychhlad28/rooms/v4, for example a function call with arguments.