Sixteen (Simon Tatham's Puzzles)
Saved games stay in this browser only.
About the puzzle
Sixteen looks like the classic fifteen puzzle, but the grid is completely full: sixteen numbered tiles and no empty space. Instead of sliding a single tile, you shift a whole row sideways or a whole column up or down, and the tile that falls off one end comes back in at the other. Put the tiles back in order, 1 to 4 across the top and 13 to 16 along the bottom.
Simon Tatham wrote it in 2004, the week he started the collection. He says he might have invented it himself, by accident, while trying to copy a screensaver he half remembered.
Rules
- A move shifts one row left or right, or one column up or down, by one square.
- The tile pushed off the edge reappears at the other end of the same row or column.
- The puzzle is solved when the tiles read in order from left to right and top to bottom.
Controls
| Input | Action |
|---|---|
| Left click on an arrow | shift that row or column in the arrow's direction |
| Right click on an arrow | shift it the opposite way |
| Arrow keys | move the cursor around the arrows on the edge |
| Enter | shift the row or column at the cursor |
| Control + arrow key (cursor on a tile) | move the tile and keep the cursor on it |
| Shift + arrow key (cursor on a tile) | move the tile and leave the cursor where it is |
| N / U / R | new game / undo / redo |
With the cursor on a tile, Enter works like holding Control and Space like holding Shift, until you press it again. The status bar counts your moves.
How to solve it
Build the top row first. Bring each tile of the first row up its column and shift the top row to line them up. While the top row is unfinished, shifting it costs nothing.
Then protect what is done. Once the top row is right, you can still move a column, as long as you shift it back afterwards. Move a column down, shift a lower row to bring the right tile under it, then move the column back up: the top row is restored and one tile has changed.
Learn a three-tile cycle. Column down, row left, column up, row right (four moves) moves three tiles round in a small cycle and leaves everything else alone. It is the main tool for the last row, where there is no free space left to work in.
Finish the bottom row with cycles. When only the last row is left, use the cycle above with different columns until every tile drops into place. On some grid sizes, the last two tiles cannot simply be swapped; the generator only deals positions that can be solved, so if you seem to need a single swap, an earlier cycle went the wrong way.
Try short shuffles. In Custom you can ask for an exact number of shuffling moves. A four-move shuffle solved in four moves is a neat exercise in reading the grid backwards.
Sizes
The Type menu has 3x3, 4x3, 4x4, 5x4 and 5x5 grids. Custom sets the width and height and, optionally, a fixed number of shuffling moves instead of a full shuffle.
Playing here
Click Play to open the puzzle. The menu above the board has New game, Restart, Undo, Redo and Solve (which you can undo to keep going on your own), the Type menu with the sizes, and the Game menu, where you can type in a game ID or a random seed, download the current game as a file, load a saved file and change the preferences. Your game in progress is kept in this browser and comes back with its whole undo history the next time you open the page.
On a touch screen, tap an arrow to shift its row or column; turn on the Mark button above the board to shift the other way.
Credits and licence
Sixteen is part of Simon Tatham's Portable Puzzle Collection, written by Simon Tatham with code contributed by several other authors, and distributed with its source code under the MIT licence. This page runs a WebAssembly build made by FredyGames from the author's official source snapshot, with no changes to the puzzle; the source and the build script are hosted with the game, and the licence text is linked from this page.