The Hanoi Towers Puzzle Model shows a stack of different sized disks on the left most of three posts. The objective is to move the stack of disks from the left post to the right post while only moving one disk at a time and never placing larger disks on top of smaller disks. The puzzle is easily solved with stacks of one or two disks, but the complexity quickly grows as the number of disks increases. For example, three disks can be solved with seven moves, but seven disks require 127 moves. The user may manually solve the Hanoi Towers problem using the arrow buttons at the bottom of the display, but the main feature of the model is the recursive algorithm used to solve the puzzle algorithmically.
The Hanoi Towers Model was developed using the Easy Java JavaScript Simulation (EjsS) modeling tool. It is distributed as a ready-to-run (compiled) Java archive. Double clicking the jar file will run the program if Java is installed. You can modify this simulation if you have EJS installed by right-clicking within the map and selecting "Open Ejs Model" from the pop-up menu item.
Please note that this resource requires
at least version 1.7 of Java (JRE).
Hanoi Towers Puzzle Source Code
The source code zip archive contains an XML representation of the Hanoi Towers Puzzle Model. Unzip this archive in your EjsS workspace to compile and run this model using EjsS. download 209kb .zip
Last Modified: September 15, 2014
T. Murray, Computer Program HANOI TOWERS PUZZLE MODEL (2014), WWW Document, (https://www.compadre.org/Repository/document/ServeFile.cfm?ID=13343&DocID=3913).
Murray, T. (2014). Hanoi Towers Puzzle Model [Computer software]. Retrieved December 8, 2024, from https://www.compadre.org/Repository/document/ServeFile.cfm?ID=13343&DocID=3913
%0 Computer Program %A Murray, Tyler %D September 15, 2014 %T Hanoi Towers Puzzle Model %8 September 15, 2014 %U https://www.compadre.org/Repository/document/ServeFile.cfm?ID=13343&DocID=3913
Disclaimer: ComPADRE offers citation styles as a guide only. We cannot offer interpretations about citations as this is an automated procedure. Please refer to the style manuals in the Citation Source Information area for clarifications.