Three-Dimensional Simulation of the Tower of Hanoi Using an Improved Recursive Algorithm and Multipatch
摘要
To address the limitations of console output in the traditional teaching of the Tower of Hanoi, we propose a novel method for three-dimensional (3D) simulation of it by using an improved recursive algorithm and the Multipatch component in ArcGIS Engine (AE). The method utilizes object-oriented programming to design the cylinders and disks within the Tower of Hanoi scenario and employs the Multipatch component to render the 3D objects during the simulation. The enhanced recursive algorithm is leveraged to display dynamic position changes of the disks on the cylinders, complemented by a 3D visualization program that includes textual information. The design and implementation of simulation program has been illustrated to students in teaching practice. The obtained results have shown that the simulation of the 3D Hanoi Tower significantly improves student performance metrics like average test scores, engagement level, conceptual understanding, completion time of tasks, and error rate in solutions, which will foster a deeper understanding of programming concepts and algorithmic thinking.