Classic recursion puzzle

🗼 Tower of Hanoi

Move the whole tower to another peg — one disc at a time, never a bigger disc on a smaller one. Try to hit the optimal 2ⁿ−1 moves, or sit back and watch the recursive solver do its dance.

Moves 0
Optimal 31
Discs5

Click a peg to lift its top disc, click another peg to drop it (or drag the disc). Keyboard: 1/2/3 pick and drop. Legend says monks in Hanoi move 64 golden discs — at one per second that's 585 billion years.