How to play
The board has three pegs. Every disk starts on the left peg, stacked from largest at the bottom to smallest on top. Your job is to rebuild the same tower on the right peg.
Only two rules apply:
- You move one disk per move, and it has to be the top disk of its peg.
- A disk may land on an empty peg or on a larger disk, never on a smaller one.
To move, tap the peg holding the disk you want; its top disk lifts up. Then tap the peg where it should go. If you change your mind, press Escape on a keyboard to put it back down. The keys 1, 2 and 3 select the left, middle and right pegs, so you can play the whole puzzle without a mouse.
The Disks buttons choose a tower from 3 to 8 disks; four is where a new game starts. The bar shows your Moves, the Best possible count for this size, and a running clock. Start over resets the current tower, Undo takes back your last move, and Hint plays one move for you.
When the last disk lands on the right peg, the game reports your moves and time. Finishing in the minimum with no hints earns “Perfect”. After a win you can jump straight to a tower one disk taller.
The minimum number of moves
For n disks the shortest solution takes 2ⁿ − 1 moves, and you can see why from the biggest disk. It can only move once everything else is out of its way, stacked on the middle peg. So you must move a tower of n − 1 disks to the middle, move the big disk across in one move, then move the n − 1 tower again on top of it. Each extra disk doubles the work and adds one.
| Disks | Fewest moves |
|---|---|
| 3 | 7 |
| 4 | 15 |
| 5 | 31 |
| 6 | 63 |
| 7 | 127 |
| 8 | 255 |
The puzzle was published in 1883 by the French mathematician Édouard Lucas, along with a story about monks moving 64 golden disks. With 64 disks the minimum is 2⁶⁴ − 1, more than 18 quintillion moves.
Undo, hints and the perfect score
A detail that catches people out: Undo counts as a move. It puts the disk back, but your move counter still goes up by one, so an undo means you can no longer reach the minimum on that tower. If you want a perfect run after a slip, Start over instead.
Hint works from wherever you are, not only from the start. It computes the shortest path from your current position to the finished tower and makes its first move. That makes it useful for getting unstuck after a long detour, but each hint counts as a move and rules out “Perfect” for that game.
Strategy
Know where the smallest disk goes first. With an odd number of disks, move the smallest disk to the right peg; with an even number, move it to the middle. Get this wrong and you build the tower on the wrong peg and need many extra moves.
Keep the smallest disk circling. In the shortest solution, the smallest disk moves on every other turn, always in the same direction around the three pegs (left → right → middle → left for odd towers, the other way for even ones).
Between small-disk moves, there’s only one option. Once the smallest disk has moved, exactly one legal move doesn’t involve it: the smaller of the two other top disks goes onto the other peg. You don’t need to think, just make it.
Think in sub-towers. To move a 6-disk tower, you need to move a 5-disk tower out of the way, and to do that, a 4-disk one, and so on. If you lose track, ask yourself where the biggest disk that’s still in the wrong place needs to go, and which peg its smaller companions must clear to.
Climb gradually. Solve 3 and 4 disks perfectly until the rhythm feels automatic, then use the “Try n disks” button to step up. An 8-disk tower is 255 moves, and one wrong turn of the smallest disk costs a lot.
If you enjoy sliding things into order, Sliding Puzzle has the same plan-ahead feel, and Peg Solitaire is another classic single-player puzzle with a strict rule and one goal.
If you enjoy Tower of Hanoi, try Five Letters or Hangman next.