Sliding Fifteen
Public domain classic
Slide the tiles into order.
At a glance
- Puzzle
- Put the numbered tiles in order, left to right from the top, with the gap ending in the bottom right corner
- Sizes
- 4 by 4 (15 tiles), set when the page opens, 3 by 3 (8 tiles) and 5 by 5 (24 tiles)
- Controls
- Tap or click a tile next to the gap. Arrow keys slide the tile on the far side of the gap toward it. Esc pauses
- Shuffle
- A new board at any time from the Shuffle button
- Score
- 10,000 minus 10 for every move and 1 for every second, never below 1
- Saves
- Your fewest moves for each size and one best score, in this browser only
- Cost
- Free, no account
How this sliding puzzle plays
- Each new board is made by sliding tiles at random from the solved position, 100 slides for every cell: 900 on 3 by 3, 1,600 on 4 by 4 and 2,500 on 5 by 5. A slide never undoes the one just before it, and if the board still ends up solved, one more slide is made.
- Only a tile beside the gap, above, below, left or right, can move. A tap on any other tile does nothing.
- A tile takes about 0.14 seconds to slide, and taps or keys during the slide are ignored. Every slide counts as one move.
- Arrow keys move the tile on the far side of the gap: Left slides the tile to the right of the gap into it, Up slides the tile below it, and so on. They never wrap from the end of one row to the start of the next.
- A tile sitting in its own place is drawn in a brighter shade.
- The clock only runs while you play. Pause, Esc or another tab stops it.
- The moment the last tile lands in place, the puzzle ends and shows your moves, your time and the fewest moves for that size.
Why every board can be solved
Every shuffle is a string of legal slides from the solved board, so the same slides played backwards always lead home. The rule test checked this a second way, with the parity count that tells a solvable board from one that can never be solved. All 600 test shuffles, 200 at each size, passed it. A solved 4 by 4 board with only the 14 and 15 swapped fails it, and no amount of sliding fixes that board.
On 3 by 3 the test went further. Starting from the solved board it found every position that slides can reach: 181,440, exactly half of the 362,880 ways to lay out eight tiles and a gap.
How many moves a board needs
For 300 shuffled 3 by 3 boards the test worked out the fewest moves that would solve each one. The easiest needed 4, the middle board 22 and the hardest 28. The hardest 3 by 3 position of all needs 31. On the starting boards about 7 of the 8 tiles were out of place on 3 by 3, about 14 of 15 on 4 by 4, and 23 of 24 on 5 by 5.
- Moves cost more than seconds. Each move takes 10 off the score and each second only 1, so a slow, short solution beats a fast one full of extra slides.
- Watch the bright tiles. A tile in its own place changes shade, which helps you keep a finished row intact while you work below it.
- Shuffle costs nothing. It deals a new board and resets the moves and the clock, so you can skip a board you do not like.
- Start small. The 3 by 3 board needs at most 31 moves with perfect play, which makes it a good place to practise before 4 by 4.
For a number puzzle with no moving parts, try Sudoku.
Known limits
- No undo and no hint.
- The best score is one number shared by all three sizes, so a quick 3 by 3 can set a best that a 5 by 5 will not beat. The fewest-moves record is kept for each size.
- A shuffle can come out easy: one of the 300 test boards on 3 by 3 needed only 4 moves.
- Changing the size needs the New button, which ends the board in progress.
- On a 390 by 844 screen the cookie notice covered the Play button in our check until it was answered.
- At 1280 by 720 the game frame is 848 pixels tall, taller than the window, so scroll or use Fullscreen to see the whole board.
- Switching tabs pauses the game and stops the clock.
- If storage is blocked, your best results are not kept.
How it was built and checked
- AI tool
- Codex
- First committed
- 2026-10-14, in a batch of 10 classic games
- Size
- One HTML file of 169 lines, no game libraries
- Rounds of changes
- 1, from the build record
- Checked at build
- A syntax check and two simulated checks: each size dealt every tile once, and a board one slide from solved finished when that slide was made. The build report names real browser rendering, physical touch input and full human playthroughs as not verified
- Checked since
- 2026-11-11: a new rule test (2,138 checks covering 600 shuffles and their parity, a search of all 181,440 reachable 3 by 3 boards, slides, arrow keys, taps at both screen sizes, the finish and the score, best results per size, Shuffle, Play Again, New, pause and the clock), and an automated browser check of the local build at 1280 by 720 and 390 by 844. Each time it pressed Play (4 by 4 on desktop, 3 by 3 on the phone after answering the cookie notice), tapped a tile beside the gap, slid one with an arrow key, pressed Shuffle and got a new board, set a board one slide from solved, finished it with a tap, and pressed Play Again for a fresh shuffle
- Played on a phone
- 2026-11-11, a full game on a real phone before this page went live
Embed Sliding Fifteen on your site
Free to embed. Please keep the credit link.
<div style="position:relative;padding-top:75%;max-width:640px"><iframe src="https://aivibecodedgames.com/games/sliding-fifteen/" title="Sliding Fifteen (free browser game)" style="position:absolute;inset:0;width:100%;height:100%;border:0" loading="lazy" allow="fullscreen" allowfullscreen></iframe></div> <p><a href="https://aivibecodedgames.com/play/sliding-fifteen/">Play Sliding Fifteen free</a> on AI Vibe Coded Games</p>
How it was vibe coded
The opening prompt
Make the 15 sliding tile puzzle on a 4x4 grid (also 3x3 and 5x5 options). Shuffle only to solvable states by making random legal moves from solved. Smooth tile slide animation, move counter, timer, best per size in localStorage, new shuffle button, nice completion burst.
Game controls
- Tap or click a tile next to the gap
- Arrow keys also work
The game brief includes touch controls for phones.
Open the game on its own