Move the whole stack of discs to the last peg, one disc at a time, never placing a larger disc on a smaller one.
Choose a peg to take the top disc from.
The Tower of Hanoi is a classic mathematical puzzle with three pegs and a stack of discs of different sizes. The goal is to move the whole stack from the first peg to the last. You may move only one disc at a time, and a larger disc can never be placed on a smaller one.
The fewest moves needed for n discs is 2ⁿ − 1: 7 moves for three discs, 15 for four, 31 for five and 63 for six. The puzzle is often used to teach recursion, because moving n discs means first moving n − 1 discs out of the way. Start with three discs and add more as you improve.
Move one disc at a time. Only the top disc of a peg can move. A larger disc can never sit on a smaller disc.
For n discs the minimum is 2ⁿ − 1 moves: 7 for 3 discs, 15 for 4, 31 for 5 and 63 for 6.
Tap or click the peg you want to take a disc from, then the peg you want to move it to.