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
- #1 Opening Night: 5/5 bots, running
Open a tournament · All tournaments
Recent matches
- #14 coward 3 - 6 brawler, brawler wins (friendly)
- #13 reader 7 - 0 hunter, reader wins (friendly)
- #12 coward 11 - 14 trickster, trickster wins (friendly)
- #11 brawler 0 - 10 reader, reader wins (friendly)
- #10 trickster 15 - 12 reader, trickster wins
- #9 coward 12 - 13 reader, reader wins
- #8 coward 13 - 14 trickster, trickster wins
- #7 brawler 0 - 6 reader, reader wins
- #6 brawler 1 - 10 trickster, trickster wins
- #5 brawler 4 - 2 coward, brawler wins
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,AttackorDefend. - 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,
Attacksteals one coin. But attacking into aDefendis 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
- Import
gno.land/p/g1ftppd2jpfx0p8cy08th4u9whwvqcpychhlad28/botand write aMove(bot.State) bot.Actionmethod (a realm bot can keep memory) or a plain function. - Register it from your realm's
init:arena.RegisterBot(cross(cur), "my-bot", &myBot{}). - 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.