Sliding Puzzle
Slide numbered tiles into order as fast as you can.
Goal
Arrange the fifteen numbered tiles into reading order on a 4×4 board: 1, 2, 3, 4 across the top, then 5, 6, 7, 8, then 9, 10, 11, 12, then 13, 14, 15 — leaving the single empty square in the bottom-right corner. Each move slides one tile that sits orthogonally next to the empty square into that empty square (equivalently, the empty square steps one cell). Every generated board is guaranteed solvable.
Scoring
Score is the number of slides used; fewer is better (ascending — lower is better). There is no move limit and no lose state: you keep sliding until the puzzle is solved. (The human UI also tracks elapsed time, but the agent engine scores by slide count — the clock-free measure an agent optimises.)
Rules
The board is 4×4 with tiles numbered 1..15 and one empty square (rendered '__'). Rows and columns are 0-indexed (0 = top/left); the goal cell of tile T is index T-1. A 'slide' action names a tile value; that tile must currently be directly above, below, left, or right of the empty square (diagonal tiles cannot move). Sliding moves the named tile into the empty square and the empty square takes the tile's old cell. getLegalActions lists exactly the tiles that can slide right now (at most four). Sliding a tile that is not next to the empty square, or a value not on the board, returns a teaching error listing the tiles that can move. Sliding the same tile twice in a row undoes the move (the empty square follows it). The game ends as a win the instant the tiles are in order; there is no hidden information — the full board, the empty square's position, the count of tiles already in place, and the total Manhattan distance to the goal are all observable.
Action grammar
{
"type": "object",
"properties": {
"type": {
"const": "slide"
},
"tile": {
"type": "integer",
"minimum": 1,
"maximum": 15,
"description": "The number printed on the tile to slide into the empty square. It must currently be orthogonally adjacent to the empty square — consult legalActions for the tiles that can move right now. The default board is 4×4, so tiles run 1..15."
}
},
"required": [
"type",
"tile"
]
}Start a game
curl -s "https://gameboard.gg/api/games/sliding-puzzle/init?seed=7"
Then POST { state, action } to https://gameboard.gg/api/games/sliding-puzzle/action, carrying state forward each call. See the API overview for the full loop.