š¼ Tower of Hanoi
Move all discs from peg A to peg C. Never place a larger disc on a smaller one.
Tap a peg to pick up its top disc, then tap another peg to place it.
ā How to Play Tower of Hanoi
- All discs start stacked on Peg A, largest at the bottom.
- Tap a peg to select its top disc (it highlights green).
- Tap another peg to move the disc there ā but you can never place a larger disc on a smaller one.
- Move all discs to Peg C to win.
- Try to match the optimal move count: 2āæā1 moves for n discs (e.g. 7 moves for 3 discs).
Common Questions
What is the minimum number of moves?
The optimal solution requires exactly 2āæā1 moves, where n is the number of discs. That's 7 moves for 3 discs, 15 for 4, 31 for 5, 63 for 6, and 127 for 7 discs.
What is the trick to solving it?
The recursive strategy: to move n discs from A to C using B as spare ā move the top nā1 discs from A to B, move the largest disc from A to C, then move the nā1 discs from B to C.
Can I use Peg B as a destination?
Yes ā you can place discs on any of the three pegs at any time, as long as you never put a larger disc on top of a smaller one. Peg B is a helper peg used as temporary storage.
Is my best score saved?
Yes ā your best (lowest) move count for each disc count (3ā7) is saved in your browser.
Optimal Move Counts
| Discs | Optimal Moves | Difficulty |
|---|---|---|
| 3 | 7 | š¢ Beginner |
| 4 | 15 | š¢ Easy |
| 5 | 31 | š” Medium |
| 6 | 63 | š Hard |
| 7 | 127 | š“ Expert |
š® More Games on ToolsInsta
Play more free browser games ā no download, no sign-up needed.