Problem: In the classic Towers of Hanoi problem we are given 3 pegs numbered 1 to 3 and a number of disks (D) of differing radii all initially on peg 1 with the largest on the bottom and smallest on the top. These disks must be moved one at a time from peg 1 to peg 3 using peg 2 as an intermediate peg always moving the topmost disk on any peg and with the requirement that a larger disk must never rest on top of a smaller disk. The correct solution is completed in the fewest possible moves and provides a list of all disk moves required.
Solution: This could be solved very laboriously. But there's a better way! Just enter the D value (nonzero) below and click the Solve button.
Errors
{{ error }}
Solving
{{ message }}
Solutions
-
{{ solution.step }}