************** Tower of Hanoi ************** .. tags:: short, game, puzzle The Tower of Hanoi is a stack-moving puzzle game that features three poles on which you can stack various-sized disks. The object of the game is to move one tower of disks to another pole. However, only one disk can be moved at a time, and larger disks cannot be placed on top of smaller ones. Figuring out a certain pattern will help you solve this puzzle. Can you discover it? (Hint: Try setting the TOTAL_DISKS variable to 3 or 4 to solve an easier version first.) .. collapse:: tower_of_hanoi.py .. literalinclude:: tower_of_hanoi.py :language: python :linenos: https://inventwithpython.com/bigbookpython/project77.html