How to play Tower of Hanoi
- Pick how many disks to play with. Three is a quick warm-up; each extra disk roughly doubles the work.
- Click a peg to lift its top disk, then click the peg where it should go, or drag the disk across. A disk can only go on an empty peg or on a bigger disk.
- Move the whole stack from the left peg to either of the other two. Try to match the fewest possible moves shown above the board.
Tips for the Tower of Hanoi
- The first move decides where the stack ends up. With an odd number of disks, move the smallest disk straight to the peg you want the stack on; with an even number, move it to the other peg first.
- Move the smallest disk on every other turn and always send it the same way round the pegs. On the turns between, there’s only ever one legal move that doesn’t touch it.
- Everything you do is about freeing the bottom disk and putting it on an empty peg, and the smaller disks are only being cleared out of the way.
- Undo moves the disk back, and that counts as a move too, so a mistake costs at least two extra moves. A perfect score means no wrong moves at all.
About the puzzle
The Tower of Hanoi was published in 1883 by the French mathematician Édouard Lucas. It came with a legend about priests moving 64 golden disks, which is why it’s also known as the Tower of Brahma. The puzzle is a classic example of recursion in math and computer science: the solution for any stack is built from the solution for a stack one disk smaller. Its minimum move count, 2 to the power of n minus 1, grows so fast that 64 disks would take over 18 billion billion moves.