Material Detail

"Towers of Hanoi" icon

Towers of Hanoi

A very good implementation of the classic Towers of Hanoi problem. Teaches recursive functions and stacks as well as recurrence relations.


More about this material


Log in to participate in the discussions or sign up if you are not already a MERLOT member.
Isabel Azevedo
Isabel Azevedo (Faculty)
11 years ago

Very interesting

Audrone Matutis
Audrone Matutis (Faculty)
16 years ago
A good visual tool for teaching how to solve a classic programming problem. Segues nicely into material for dissecting the problem, developing a solution algorithm and then writing the resulting function.

Discussing the mathematical formula for determining the minimum number of moves
needed to solve the puzzle with any number of disks, makes this a good example of what programmers need to consider in order to develop efficiently running programs.

Technical Remarks:

Sometimes the applet controls were only partly visible after loading. This is easily resolved by refreshing the display.
Used in course? Yes
L Collins
L Collins (Student)
18 years ago
I played the game 10 times, and came up with increasingly better resluts.
(Scores were 32,29,23,19,21,17,19,17,17,15.) I was stuck at 17 moves, and then
watched the animation a few times. After that I was able to get down to 15
moves. I thought this game was fun and I appreciated the feedback, and also the
animation. This would be a good teaching tool for K-8 students.
Used in course? Yes