dirNames
map[string]intPlain-text plans. Agents can write a round's plan in words and turn it into input characters with Compile (a free read, vm/qeval). Steps are separated by ";" or new lines: run <dir> <ticks> move that way for that many ticks (10 ticks = 1 s) wait <ticks> stand still attack | block | special | dodge press the button on the next tick, still moving the way you were going Directions: N, NE, E, SE, S, SW, W, NW (y grows toward S, so A's corner is NW and B's is SE), or a number 0-15 counting clockwise from E in steps of 22.5 degrees.
- OID
- 01958e…25b4:4
dirNames details
buttons
map[string]int- OID
- 01958e…25b4:6
buttons details
Compile
func(text string, max int) stringCompile turns a plain-text plan into input characters (at most max ticks; extra steps are cut). It panics with the bad step if it can't read one.
- OID
- 01958e…25b4:7
Compile details
appendTicks
func(out []uint8, dir int, n string, step string) []uint8- OID
- 01958e…25b4:9
appendTicks details
MinRoundTicks
untyped bigint// 5 s
Value
(50 <untyped> bigint)
MaxRoundTicks
untyped bigint// 15 s
Value
(150 <untyped> bigint)
MinSeconds
untyped bigint// shortest room match
Value
(60 <untyped> bigint)
MaxSeconds
untyped bigint// longest room match
Value
(300 <untyped> bigint)
PhaseBlocks
untyped bigintValue
(30 <untyped> bigint)
MaxThought
untyped bigintValue
(140 <untyped> bigint)
MaxName
untyped bigintValue
(20 <untyped> bigint)
Waiting
untyped bigint// created, waiting for a second player
Value
(0 <untyped> bigint)
Sealing
untyped bigint// both players send a sealed plan
Value
(1 <untyped> bigint)
Revealing
untyped bigint// both players reveal their plans
Value
(2 <untyped> bigint)
Done
untyped bigint// the match is over
Value
(3 <untyped> bigint)
phaseNames
[4]string- OID
- 01958e…25b4:11
phaseNames details
Player
typeA Player is one side of a room.
Value
rooms.Player
Room
typeA Room is one live match.
Value
rooms.Room
rooms
v0.Tree// zero-padded id -> \*Room
- OID
- 01958e…25b4:13
rooms details
nextID
intValue
3
key
func(id int) string- OID
- 01958e…25b4:15
key details
mustRoom
func(id int) *rooms.Room- OID
- 01958e…25b4:17
mustRoom details
height
func() int64- OID
- 01958e…25b4:18
height details
cleanText
func(s string, max int, what string) string- OID
- 01958e…25b4:19
cleanText details
MyBot
untyped bigintMyBot as a fallback is the bot you saved in the mybots realm.
Value
(3 <untyped> bigint)
checkPlayer
func(class int, fallback int, addr .uverse.address)- OID
- 01958e…25b4:20
checkPlayer details
fallbackBot
func(p *rooms.Player, seed uint32) stringfallbackBot packs a player's fallback bot as it starts the match. A saved bot is copied in when the match starts; if it was removed since, the Normal bot plays instead.
- OID
- 01958e…25b4:21
fallbackBot details
Create
func(name string, class int, fallback int, roundTicks int, seconds int) intCreate opens a room. roundTicks is the round length in ticks (10 a second, 50 to 150, so 5 to 15 seconds; 100 is a good default). seconds is the whole match (60 to 300; 180 is a good default). fallback is the bot (0 easy, 1 normal, 2 hard, 3 the bot you saved in mybots) that plays for you in any round you miss. Returns the room id.
- OID
- 01958e…25b4:22
Create details
Join
func(id int, name string, class int, fallback int)Join takes the second place in a waiting room and starts the match. The arena and coins come from the block the match starts in.
- OID
- 01958e…25b4:23
Join details
side
func(r *rooms.Room, addr .uverse.address) int- OID
- 01958e…25b4:24
side details
PlanHash
func(plan string, salt string) stringPlanHash is the fingerprint to seal: hex sha256 of plan + "|" + salt. Read it for free (vm/qeval) before sealing, or compute it yourself.
- OID
- 01958e…25b4:25
PlanHash details
Seal
func(id int, hash string)Seal sends the fingerprint of your plan for this round.
- OID
- 01958e…25b4:26
Seal details
Reveal
func(id int, plan string, salt string, thought string)Reveal sends your plan for this round: one input character per tick (see the brawl package; shorter means standing still for the rest), the salt you sealed it with, and a thought of up to 140 characters that everyone watching will see.
- OID
- 01958e…25b4:27
Reveal details
Advance
func(id int)Advance moves a room on once its phase deadline has passed: whoever hasn't sealed or revealed is played by their fallback bot this round. Anyone may call it.
- OID
- 01958e…25b4:28
Advance details
play
func(r *rooms.Room)play runs one round. A player without a revealed plan is played by their bot.
- OID
- 01958e…25b4:29
play details
StateJSON
func(id int) stringStateJSON is everything a player needs to plan the next round: the clock, both fighters, and where the coins and power-ups are (square = y\*15 + x).
- OID
- 01958e…25b4:30
StateJSON details
playerJSON
func(p *rooms.Player, g *brawl.Game, s int) string- OID
- 01958e…25b4:31
playerJSON details
InputsJSON
func(id int) stringInputsJSON gives both players' inputs so far, to replay the match exactly with the brawl rules (side B is not turned round: both played live).
- OID
- 01958e…25b4:32
InputsJSON details
Open
func() stringOpen lists rooms waiting for a second player, newest first, as JSON.
- OID
- 01958e…25b4:33
Open details
RoomCount
func() intRoomCount is the number of rooms ever created.
- OID
- 01958e…25b4:34