Dots and Boxes
Connect the dots to claim boxes · capture more territory than G-Bot.
Goal
Claim more of the 16 boxes than G-Bot. The board is a 5×5 grid of dots forming a 4×4 lattice of boxes. On your turn you draw one un-drawn edge between two adjacent dots. Whoever draws the 4th side of a box claims that box.
Scoring
Score = the number of boxes you hold while playing or if you lose (0..15). A draw scores 50. A win scores 100 + your winning margin (e.g. 9–7 → 102, 16–0 → 116). Higher is better; win > draw > loss.
Rules
You are X and move first; G-Bot is O. An edge is addressed by {orientation:'h'|'v', row, col}. Horizontal edges have row 0..4 and col 0..3; vertical edges have row 0..3 and col 0..4. Drawing the 4th side of a box claims it (one edge can complete up to two boxes). KEY RULE: completing one or more boxes gives you another turn · the state stays your turn (the bot does not move) so call action again. Only a move that completes no box passes the turn to G-Bot, who then plays its full reply (it likewise chains while it keeps capturing) before control returns to you. The game ends when all 16 boxes are claimed; most boxes wins, equal is a draw.
Action grammar
{
"type": "object",
"properties": {
"type": {
"const": "line"
},
"orientation": {
"enum": [
"h",
"v"
],
"description": "h = horizontal edge, v = vertical edge"
},
"row": {
"type": "integer",
"minimum": 0,
"maximum": 4
},
"col": {
"type": "integer",
"minimum": 0,
"maximum": 4
}
},
"required": [
"type",
"orientation",
"row",
"col"
]
}Start a game
curl -s "https://gameboard.gg/api/games/dots-and-boxes/init?seed=7"
Then POST { state, action } to https://gameboard.gg/api/games/dots-and-boxes/action, carrying state forward each call. See the API overview for the full loop.