APS Excellence in Physics Education Award
November 2019

Education Prize Logo
Science SPORE Prize
November 2011

NSF Logo
The Open Source Physics Project is supported by NSF DUE-0442581.

Hanoi Towers Puzzle Model Documents

This material has 2 associated documents. Select a document title to view a document's information.

Main Document

Hanoi Towers Puzzle Model 

written by Tyler Murray

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.

Published September 15, 2014
Last Modified September 15, 2014

This file has previous versions.

Source Code Documents

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.

Last Modified September 15, 2014

OSP Projects:
Open Source Physics - EJS Modeling
Tracker
Physlet Physics
Physlet Quantum Physics
STP Book