Duo Games

How to solve a sliding puzzle: the row-by-row method

A reliable way to solve any sliding tile puzzle: finish the top row, then the left column, place the last two tiles together and rotate the corner.

4 min read

The sliding tile puzzle is one of the oldest puzzles still played every day. The 15-puzzle, a four by four frame with fifteen numbered tiles and one gap, caused a genuine craze in the United States in 1880, with newspapers printing challenges and prizes. Today it lives on as photo puzzles in phone games and as keychain toys.

Many people solve these by wiggling tiles until the picture looks right, which works on small boards and falls apart on bigger ones. There is a far calmer approach: solve the puzzle in pieces, and never undo what you have already finished.

The idea: shrink the puzzle

Any sliding puzzle can be reduced, one line at a time, to a smaller puzzle of the same kind. Solve the top row and you are left with a board one row shorter. Solve the left column and the board is one column narrower. Repeat until only a two by two corner is left, which takes a few rotations to finish.

Because you never touch a finished row or column again, the board can only get easier as you go.

Step 1: place the top row, except for the last two tiles

Take the top row tile by tile, from left to right. To bring a tile to its spot, move the gap next to the tile, then slide the tile one step towards its target. Then walk the gap around the tile to its other side and slide it again. You will repeat this "move the gap, nudge the tile" loop a lot. It feels slow at first and becomes automatic after a few boards.

Stop when only the last two tiles of the row remain. Those need a special trick.

Step 2: the last two tiles of a row go in together

If you place the second-to-last tile in its home and then try to fit the last one beside it, you will find there is no room to manoeuvre. The fix is to place them as a pair.

  1. Put the last tile of the row in the corner where the second-to-last tile belongs.
  2. Put the second-to-last tile directly underneath it.
  3. Move the gap into the empty corner on the right, then slide both tiles along: the first moves right into its home, and the second slides up beside it.

It sounds fiddly written down. Try it once on a real board and it becomes a habit.

Step 3: the left column, the same way

With the top row done, solve the left column from the top down, using the same "move the gap, nudge the tile" loop. Again, the last two tiles of the column go in as a pair: park the bottom tile in the spot meant for the one above it, put its partner beside it, and rotate both into place.

Now the unsolved part of the board is one row shorter and one column narrower. Repeat steps 1 to 3 on what remains.

Step 4: the final two by two corner

At the end, three tiles and the gap sit in a two by two square. Move the gap round and round the square in one direction; the three tiles rotate together. Keep going until they line up. Pick whichever direction needs fewer turns; on a board that was shuffled with real slides, the tiles always fall into place.

Unsolvable boards

Exactly half of all possible arrangements of a sliding puzzle cannot be solved. That is why the 1880 prize puzzles were famous: the challenge was impossible on purpose. Puzzles built by shuffling with real slides, rather than by placing tiles at random, are always solvable. Sliding Puzzle scrambles its photos this way, so every board you get has a way back.

Tips for picture puzzles

When the puzzle is a photo, large areas of sky or water can look identical. Rely on the tile numbers in those areas, and use the picture for the busy parts. In our Sliding Puzzle every tile carries a small number, and tile 1 belongs in the top left, with the numbers running across each row. You can also tap a tile further along the gap's row or column to slide several tiles in one move, which is a big time saver once you know where things are going.

The habit of finishing one part and never breaking it is useful in many puzzles. Parking Jam is another sliding puzzle, but the pieces are cars that can only move along their lane, so the thinking is about order rather than position. And if you enjoy rebuilding pictures, Jigsaw Puzzle is a jigsaw where each piece snaps into its spot.

Play the games from this article

  • Sliding Puzzle game iconSliding Puzzle

    Slide photo tiles back into place, from 3 x 3 warm-ups to 5 x 5 masterworks. 100 levels.

    Not played yet
  • Parking Jam game iconParking Jam

    Slide cars and trucks out of the way and get the yellow taxi out of a jammed lot.

    Not played yet
  • Jigsaw Puzzle game iconJigsaw Puzzle

    Rebuild beautiful travel and nature photos piece by piece. 100 jigsaw levels.

    Not played yet
All articles