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.

brawl state

Back to all declarations

TopSize

untyped bigint

TopSize is how many players the leaderboard holds.

Value

(10 <untyped> bigint)

EasyBot

untyped bigint

Opponents: the three house bots, or a ghost's id (FirstGhost and up).

Value

(1 <untyped> bigint)

NormalBot

untyped bigint

Opponents: the three house bots, or a ghost's id (FirstGhost and up).

Value

(2 <untyped> bigint)

HardBot

untyped bigint

Opponents: the three house bots, or a ghost's id (FirstGhost and up).

Value

(3 <untyped> bigint)

FirstGhost

untyped bigint

Opponents: the three house bots, or a ghost's id (FirstGhost and up).

Value

(10 <untyped> bigint)

Ghost

type

A Ghost is a ranked top-10 run, kept so others can fight it.

Value

brawl.Ghost

board

[10]string

// top runs, best first, encoded; "" is an empty place

Open
OID
0c4016…6ad0:4
board details

Inspect array

nextID

int

Value

10

runs

int

// runs submitted

Value

0

encode

func(g *brawl.Ghost) string

encode writes a ghost as "id|player|name|class|seed|gold|botGold|height|inputs". Inputs go last because their alphabet includes '|'; names can't.

Open
OID
0c4016…6ad0:7
encode details

Inspect func

gold

func(s string) int

gold reads only the gold of an encoded run.

Open
OID
0c4016…6ad0:10
gold details

Inspect func

findGhost

func(id int) *brawl.Ghost
Open
OID
0c4016…6ad0:12
findGhost details

Inspect func

mustGhost

func(id int) *brawl.Ghost
Open
OID
0c4016…6ad0:13
mustGhost details

Inspect func

cleanName

func(name string) string
Open
OID
0c4016…6ad0:14
cleanName details

Inspect func

place

func(addr string, g int) int

place returns where a score from this player would go on the board, or -1. A player holds one place; a new score must beat their old one.

Open
OID
0c4016…6ad0:15
place details

Inspect func

insert

func(s string, addr string)
Open
OID
0c4016…6ad0:16
insert details

Inspect func

Submit

func(opponent int, seed int, class int, name string, inputs string, gold int, oppGold int) int

Submit records a run. opponent is EasyBot, NormalBot, HardBot or a ghost's id; seed sets the arena and the coins (for a ghost it must be the ghost's seed). inputs are your inputs, one character per tick (see the brawl package); gold and oppGold are the final score the browser showed. A ranked run (against HardBot) good enough for the top 10 is replayed first, and the call fails if the replay disagrees. It returns your new ghost's id if the run made the top 10, or 0.

Open
OID
0c4016…6ad0:17
Submit details

Inspect func

GhostInputs

func(id int) string

GhostInputs returns a ghost's recorded inputs.

Open
OID
0c4016…6ad0:18
GhostInputs details

Inspect func

Top

func() string

Top lists the leaderboard as JSON, best first. Each entry can be fought as a ghost.

Open
OID
0c4016…6ad0:19
Top details

Inspect func

GhostJSON

func(id int) string

GhostJSON describes one ghost as JSON.

Open
OID
0c4016…6ad0:20
GhostJSON details

Inspect func

ghostJSON

func(g *brawl.Ghost) string
Open
OID
0c4016…6ad0:21
ghostJSON details

Inspect func

RunCount

func() int

RunCount is the number of runs submitted.

Open
OID
0c4016…6ad0:22
RunCount details

Inspect func

Render

func(path string) string

Render shows the leaderboard, or one ghost at "ghost/\<id>".

Open
OID
0c4016…6ad0:27
Render details

Inspect func
TopSize : untyped bigint =(10 <untyped> bigint)
EasyBot : untyped bigint =(1 <untyped> bigint)
NormalBot : untyped bigint =(2 <untyped> bigint)
HardBot : untyped bigint =(3 <untyped> bigint)
FirstGhost : untyped bigint =(10 <untyped> bigint)
Ghost : type =brawl.Ghost
board : [10]string Inspect
nextID : int =10
runs : int =0
encode : func(g *brawl.Ghost) string Inspect
decode : func(s string) *brawl.Ghost Inspect
gold : func(s string) int Inspect
player : func(s string) string Inspect
findGhost : func(id int) *brawl.Ghost Inspect
mustGhost : func(id int) *brawl.Ghost Inspect
cleanName : func(name string) string Inspect
place : func(addr string, g int) int Inspect
insert : func(s string, addr string) Inspect
Submit : func(opponent int, seed int, class int, name string, inputs string, gold int, oppGold int) int Inspect
GhostInputs : func(id int) string Inspect
Top : func() string Inspect
GhostJSON : func(id int) string Inspect
ghostJSON : func(g *brawl.Ghost) string Inspect
RunCount : func() int Inspect
classNames : [5]string Inspect
who : func(g *brawl.Ghost) string Inspect
Render : func(path string) string Inspect