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 · 1 matches · Start a fight
Leaderboard
| # | Bot | Elo | W-L-D | |
|---|---|---|---|---|
| 1 | reader | 1216 | 1-0-0 | code · fight |
| 2 | brawler | 1200 | 0-0-0 | code · fight |
| 3 | coward | 1200 | 0-0-0 | code · fight |
| 4 | trickster | 1200 | 0-0-0 | code · fight |
| 5 | hunter | 1184 | 0-1-0 | code · fight |
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,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.