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.

tavern2048/v0 package

Functions

BestOf

func BestOf(player address) int
Ask AI Claude ChatGPT

BestOf returns the best score a player ever reached.

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g15crxnxd79syggtha6ymfhy8m8a4ytqel58cwkg/tavern2048/v0.BestOf()"

Result

BestOfKey

func BestOfKey(player string) int
Ask AI Claude ChatGPT

BestOfKey is BestOf for a raw address string.

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g15crxnxd79syggtha6ymfhy8m8a4ytqel58cwkg/tavern2048/v0.BestOfKey()"

Result

HasMove

func HasMove(b [N][N]int) bool
Ask AI Claude ChatGPT

HasMove reports whether any move is still possible.

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g15crxnxd79syggtha6ymfhy8m8a4ytqel58cwkg/tavern2048/v0.HasMove()"

Result

Itoa

func Itoa(x int) string
Ask AI Claude ChatGPT

Itoa is a dependency-free int->string for realm Render.

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g15crxnxd79syggtha6ymfhy8m8a4ytqel58cwkg/tavern2048/v0.Itoa()"

Result

Move

func Move(cur realm, dir string) string
Ask AI Claude ChatGPT

Move slides the signer's board once: dir is up, down, left or right (or u, d, l, r). A move that changes nothing is not counted.

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/g15crxnxd79syggtha6ymfhy8m8a4ytqel58cwkg/tavern2048/v0" -func "Move" -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/g15crxnxd79syggtha6ymfhy8m8a4ytqel58cwkg/tavern2048/v0" -func "Move" -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) string
Ask AI Claude ChatGPT

NewGame starts a fresh board for the signer, replacing any current game. The best score ever reached is kept for the leaderboard.

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/g15crxnxd79syggtha6ymfhy8m8a4ytqel58cwkg/tavern2048/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/g15crxnxd79syggtha6ymfhy8m8a4ytqel58cwkg/tavern2048/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
  

Play

func Play(cur realm, moves string) string
Ask AI Claude ChatGPT

Play applies a sequence of moves in a single transaction, e.g. "lldrul" (u=up, d=down, l=left, r=right; spaces and commas are ignored). It stops early when the game is over. At most MaxPlayMoves moves per call.

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/g15crxnxd79syggtha6ymfhy8m8a4ytqel58cwkg/tavern2048/v0" -func "Play" -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/g15crxnxd79syggtha6ymfhy8m8a4ytqel58cwkg/tavern2048/v0" -func "Play" -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
  

Render

func Render(path string) string
Ask AI Claude ChatGPT

Render serves the tavern home (path "") or a player's board (path = g1...).

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g15crxnxd79syggtha6ymfhy8m8a4ytqel58cwkg/tavern2048/v0.Render()"

Result

ScoreOf

func ScoreOf(player address) int
Ask AI Claude ChatGPT

ScoreOf returns the current score of a player (0 if no game).

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g15crxnxd79syggtha6ymfhy8m8a4ytqel58cwkg/tavern2048/v0.ScoreOf()"

Result

NewBoard

func NewBoard() Board
Ask AI Claude ChatGPT

NewBoard returns a fresh board with the two starting tiles.

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g15crxnxd79syggtha6ymfhy8m8a4ytqel58cwkg/tavern2048/v0.NewBoard()"

Result

NewBoardSeeded

func NewBoardSeeded(seed int) Board
Ask AI Claude ChatGPT

NewBoardSeeded returns a fresh board whose two starting tiles are placed from seed, so every game starts differently but reproducibly.

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g15crxnxd79syggtha6ymfhy8m8a4ytqel58cwkg/tavern2048/v0.NewBoardSeeded()"

Result

Gno Expression Evaluator

Evaluate any read-only Gno expression against gno.land/r/g15crxnxd79syggtha6ymfhy8m8a4ytqel58cwkg/tavern2048/v0, for example a function call with arguments.