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.

cagematch state

Back to all declarations

Fight

type

Fight is one recorded battle.

Value

cagematch.Fight

Entry

type

Entry is one fighter's ladder record. Points: win 3, draw 1, loss 0.

Value

cagematch.Entry

ladder

map[string]*cagematch.Entry
Open
OID
0526d7…8f09:5
ladder details

Inspect map

Challenge

func(a string, b string) int

Challenge runs a fight between two roster fighters and records it. Anyone may call it; the fight is deterministic and its recap public. Returns the fight id.

Open
OID
0526d7…8f09:9
Challenge details

Inspect func

entry

func(name string) *cagematch.Entry
Open
OID
0526d7…8f09:11
entry details

Inspect func

winnerName

func(f *cagematch.Fight) string
Open
OID
0526d7…8f09:12
winnerName details

Inspect func

FightCount

func() int

FightCount returns how many fights have been recorded.

Open
OID
0526d7…8f09:13
FightCount details

Inspect func

GetFight

func(id int) cagematch.Fight

GetFight returns a copy of a recorded fight. Panics if unknown.

Open
OID
0526d7…8f09:14
GetFight details

Inspect func

Leaderboard

func() []cagematch.Entry

Leaderboard returns ladder entries sorted by points, then name.

Open
OID
0526d7…8f09:15
Leaderboard details

Inspect func

less

func(a cagematch.Entry, b cagematch.Entry) bool
Open
OID
0526d7…8f09:16
less details

Inspect func

RosterNames

func() []string

RosterNames lists the fighters available to challenge with.

Open
OID
0526d7…8f09:17
RosterNames details

Inspect func

FightRecapJSON

func(id int) string

FightRecapJSON renders a fight recap as compact JSON. Frames are flat arrays: \[round, ax, ay, bx, by, ahp, bhp, aact, adir, bact, bdir, admg, bdmg].

Open
OID
0526d7…8f09:18
FightRecapJSON details

Inspect func

Render

func(path string) string

Render is the gnoweb entry point. Routes: "" home, "f/\<id>" a fight.

Open
OID
0526d7…8f09:19
Render details

Inspect func

renderFight

func(f *cagematch.Fight) string
Open
OID
0526d7…8f09:22
renderFight details

Inspect func
Fight : type =cagematch.Fight
Entry : type =cagematch.Entry
fights : []*cagematch.Fight (len=4) Inspect
ladder : map[string]*cagematch.Entry Inspect
ladderOrder : []string (len=3) Inspect
assert : func(cond bool, msg string) Inspect
Challenge : func(a string, b string) int Inspect
record : func(r engine.Recap) Inspect
entry : func(name string) *cagematch.Entry Inspect
winnerName : func(f *cagematch.Fight) string Inspect
FightCount : func() int Inspect
GetFight : func(id int) cagematch.Fight Inspect
Leaderboard : func() []cagematch.Entry Inspect
less : func(a cagematch.Entry, b cagematch.Entry) bool Inspect
RosterNames : func() []string Inspect
FightRecapJSON : func(id int) string Inspect
Render : func(path string) string Inspect
renderHome : func() string Inspect
renderFight : func(f *cagematch.Fight) string Inspect
pos : func(p engine.Pos) string Inspect