Play built-insArena+ New botLeaderboardRules
A two-player game of edges and territory. Players take turns drawing one edge between adjacent dots. Closing the fourth side of a box claims it and earns another move. When every edge is drawn, the player who claimed more boxes wins.
A grid of 5 x 5 boxes, so 6 x 6 dots. There are 60 edges in total (30
horizontal, 30 vertical) and 25 boxes. The box count is odd on purpose: a
two-player game can never tie, so there is always a clean winner.
Edges are addressed by orientation and grid position:
H(r, c) runs left-to-right. It is the top of box
(r, c) and the bottom of box (r-1, c). Valid for r in 0..=5, c in
0..5.V(r, c) runs top-to-bottom. It is the left of box
(r, c) and the right of box (r, c-1). Valid for r in 0..5, c in
0..=5.Box (r, c) is bounded by H(r, c) (top), H(r+1, c) (bottom), V(r, c)
(left), and V(r, c+1) (right).
The game is not simultaneous. On each turn exactly one player (the one with
to_move) draws one undrawn edge.
Seat 0 moves first. Both seats are asked for an action every turn, but only the mover's action is applied; the other seat's action is ignored.
An action that is illegal, malformed, or missing (a timeout or a crash) does not forfeit the game. The engine plays the first undrawn edge on the mover's behalf, so a match always lasts exactly 60 turns, one per edge.
Your bot receives the full board each turn (it is a perfect-information game):
{
"you": 0,
"to_move": 0,
"rows": 5,
"cols": 5,
"h": [[false, false, false, false, false], ... 6 rows],
"v": [[false, false, false, false, false, false], ... 5 rows],
"owner": [[-1, -1, -1, -1, -1], ... 5 rows],
"scores": [0, 0],
"turn": 0,
"nonce": 123456789
}
h[r][c] / v[r][c] are true when that edge is already drawn.owner[r][c] is the seat that closed box (r, c), or -1 if it is still open.scores[seat] is the boxes claimed so far.to_move is whose turn it is. Act only when to_move == you; an action on the
other player's turn is ignored.nonce is per-match entropy. The board always starts empty, so a bot that uses
no randomness plays the same game every match; fold nonce into your randomness
if you want variety.Name one undrawn edge:
{ "orient": "H", "r": 2, "c": 3 }
orient is "H" or "V". The edge must be in bounds and not already drawn.
The match ends when all 60 edges are drawn. Finishing order is by boxes claimed, most first. With 25 boxes the result is always decisive.
Greedy bot does the first two but not the third, so it is
beatable by a bot that counts chains.There is no per-turn randomness; the match seed only sets nonce, which lives in
the state. A replay re-runs bit-identically.