Tower of Hanoi Planning

Tower of Hanoi Strategy

Transfer the stack of disks from Peg A to Peg C. You may move only one disk at a time, and never place a larger disk onto a smaller disk.

Select Number of Disks

Challenge at a Glance

Focus
Logic & Executive Planning
Best For
Computer science students, engineers, mathematicians, and puzzle enthusiasts
Privacy
100% in your browser: scores are never uploaded
Duration
1–10 Minutes
Cost
Free Forever
Verified
November 2026

Task Objective & Session Structure

Primary Objective

Move the full stack of disks from the first peg to the third peg, one disk at a time, never placing a larger disk on a smaller one, in as few moves as possible.

Session Format

Untimed puzzle with a move counter, an undo button and an efficiency result

How to Play (Step-by-Step)

1

Choose the number of disks

Select 3, 4 or 5 disks. Each button shows the minimum number of moves for that size.

2

Select a source peg

Click the peg whose top disk you want to move.

3

Select a destination peg

Click the peg where you want to place it. Illegal moves are blocked and a message explains why.

4

Move the stack to the third peg

Keep going until all disks are on the third peg. Use Undo to take back a move. The game then shows your moves, the minimum and your efficiency.

Supported Input Controls

In-Game ActionInput Method / Shortcut
Select / Move DiskClick on a peg to select or drop top disk
Undo MoveClick "Undo" button to reverse last move

Trial Mechanics & Lifecycle

Disk Selection

Scoring Impact

You click a peg to pick up its top disk.

Nothing is counted until the disk is placed.

Disk Placement

Scoring Impact

You click a destination peg. If that peg is empty or its top disk is larger, the move succeeds. Otherwise the game blocks the move and shows an illegal move message.

A legal move adds 1 to the move counter. Blocked moves are not counted.

Undo

Scoring Impact

The Undo button takes back your most recent move.

Undoing reduces the move counter.

Victory Check

Scoring Impact

When all disks are stacked on the third peg, the game shows the number of moves, the theoretical minimum (2^n − 1) and your efficiency.

Efficiency = minimum moves ÷ your moves × 100, rounded.

Scoring & Benchmark Tiers

Scoring Formula

Efficiency = (minimum moves ÷ moves you used) × 100, rounded, where the minimum is 2^n − 1 for n disks. 100% means you solved it in the fewest possible moves.

There are no penalties. Illegal moves are blocked and are not counted, and you can undo moves freely.

Performance Benchmarks
Optimal

100% efficiency

You used the minimum number of moves.

Strong

80% – 99% efficiency

A few extra moves, recovered quickly.

Exploratory

Under 80% efficiency

Trial and error with some back-and-forth moves.

Cognitive Faculties Exercised

Scientific Background & Paradigm

Invented in 1883 by French mathematician Édouard Lucas, Tower of Hanoi is a staple textbook example of recursion in computer science, used to teach mathematical induction and call stacks.

Gameplay Strategy & High-Score Tips

Know the pattern for the smallest disk

With an odd number of disks, start by moving the smallest disk to the third peg. With an even number, start by moving it to the middle peg.

Alternate moves

Move the smallest disk, then make the only other legal move, and repeat. Do not move the smallest disk twice in a row.

Think in sub-goals

To move a stack of n disks, move the top n − 1 to the spare peg, move the largest disk, then move the n − 1 disks on top of it.

Use Undo to explore

If you lose track, undo a few moves rather than starting over.

Non-Clinical Educational Disclaimer

  • This game models the standard 3-peg Tower of Hanoi. Variations with 4 or more pegs, which have different minimum moves, are not included.
  • The game offers 3, 4 and 5 disks only.
  • Designed for recreation and learning; it is not a clinical test.

Frequently Asked Questions

The minimum is 2^n − 1 moves for n disks. That is 7 moves for 3 disks, 15 for 4 disks and 31 for 5 disks.

More Mind Suite challenges

See all 32 challenges