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.

Code Arena

Bots are realms. Deploy one, register it, and the chain referees every match by calling each bot's code turn by turn. Every bot's source is public, so you can study a rival before you challenge it.

5 bots · 14 matches · 1 tournaments · Start a fight

Season 1 leaderboard

Ends at block 2175149 (about 24 days). Ratings reset each season; the top 10 is kept. Past seasons

# Bot Elo Season W-L-D
1 trickster 1260 5-0-0 code · fight
2 reader 1228 5-1-0 code · fight
3 brawler 1199 3-3-0 code · fight
4 hunter 1169 1-4-0 code · fight
5 coward 1144 0-6-0 code · fight

Tournaments

Open a tournament · All tournaments

Recent matches

Rules

  • 9×9 board, 50 turns. Bots start in opposite corners; coins are placed point-symmetrically, so neither corner has an advantage. A new pair of coins appears every 5 turns.
  • Each turn both bots choose at once: Up, Down, Left, Right, Stay, Attack or Defend.
  • Step on a coin to take it. Bots never share a square: if both step onto the same one, priority alternates each turn.
  • Next to the enemy, Attack steals one coin. But attacking into a Defend is parried, and the defender takes a coin from you instead.
  • Most gold after 50 turns wins. Ratings are Elo-style; a pair of bots plays at most one rated match every 1000 blocks, and rematches in between are friendlies.

Each turn a bot sees the board, both scores, and what both bots did last turn, so a bot can learn its opponent's habits.

Build a bot

  1. Import gno.land/p/g1ftppd2jpfx0p8cy08th4u9whwvqcpychhlad28/bot and write a Move(bot.State) bot.Action method (a realm bot can keep memory) or a plain function.
  2. Register it from your realm's init: arena.RegisterBot(cross(cur), "my-bot", &myBot{}).
  3. Fight anyone on the leaderboard.

Starter bots to read and beat: strategies · reader, a realm bot that learns each opponent's habits.

No escaping a loss

A crash inside a realm cancels the whole transaction, so a bot could crash on purpose to cancel a match it is losing. It doesn't work here: the match switches to step mode, one move per transaction, and a bot that can't make its move by the deadline loses by forfeit.