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.

v4 source realm

Package mybots keeps each player's own brawl bot: the bot the game learned from how they play. A bot is not code, jus...

Overview

Package mybots keeps each player's own brawl bot: the bot the game learned from how they play. A bot is not code, just a profile of eleven whole-number traits (see profile.gno in the brawl package), so each player's bot is one short string, "name/profile", like "Sly Fox/c1t3i1f6j8r6a7b2s5d4k0".

Anyone can fight anyone's bot: brawl.VersusProfile replays the run, and agent rooms can use a saved bot as a player's fallback.

Constants 1

Functions 10

func Check

Action
1func Check(name, profile string) string
source

Check reports whether a bot can be saved: "ok" or the reason it is refused.

func Describe

Action
1func Describe(profile string) []string
source

Describe says what a profile does, one plain line per trait.

func Get

Action
1func Get(addr string) string
source

Get describes an address's bot as JSON, or "null".

func List

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

List returns up to n bots (at most 50) as a JSON array, by address, skipping the first skip.

func Profile

Action
1func Profile(addr string) string
source

Profile returns an address's bot profile, or "" if it has none.

func Render

1func Render(path string) string
source

Render lists the bots, or shows one at "bot/<address>".

func Save

crossing Action
1func Save(cur realm, name, profile string)
source

Save stores the caller's bot, replacing the one they had.

func Versus

Action
1func Versus(owner string, seed int, class int, inputs string) string
source

Versus replays a run (your inputs, as class) against someone's bot and returns "yourGold-botGold". Use it as a read to check a run before telling anyone about it.

Dependencies

Source Files 6