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.

moves source realm

Package moves is the book of move recipes for the Code Arena brawler.

Overview

Package moves is the book of move recipes for the Code Arena brawler.

A recipe is a special move written as data, like "Blink Thief/84/D82S11": a name, a cooldown and up to three effects (see recipe.gno in the brawl package for the format and the budget). Anyone can publish one; the browser lets you equip any published move for practice, and the chain's rules run it exactly like the browser does.

Built to be cheap: a recipe is stored as one short string, "author recipe", and bucketSize recipes share one tree node, so most publishes only pay for their own few dozen bytes. Each author also has one string listing their ids.

Constants 1

Functions 9

func ByAuthor

Action
1func ByAuthor(addr string) string
source

ByAuthor returns an author's moves as a JSON array, oldest first.

func Check

Action
1func Check(recipe string) string
source

Check reports whether a recipe is valid and what cooldown it needs, without storing anything: "ok <cost>" or the reason it is refused.

func List

Action
1func List(skip, n int) string
source

List returns up to n moves as a JSON array, newest first, skipping the newest skip.

func Publish

crossing Action
1func Publish(cur realm, recipe string) int
source

Publish checks a recipe and stores it under the caller's address. It returns the move's id. An author can publish MaxPerAuthor moves.

func Render

1func Render(path string) string
source

Render shows the newest moves, one move at "move/<id>", or an author's moves at "by/<address>".

Dependencies

Source Files 7

Directories 3