Load the project (*.ZIP) by clicking the appropriate button.
|
Project Description
The Hanoi Towers Problem This famous game was invented by a French matematician, Lucas. who was then a teacher in St Louis College of Paris. Three vertical needles are regularly spaced on a board. At the beginning, N disks lie on the left needle, the largest at the bottom and the other ones, smaller and smaller up to the top of the heap. The game consists in moving all the N disks, respecting the two following rules: 1) move only one disk at a time, 2) never put a disk on a smaller one. We can prove that the number of necessary disk shifts is 2^N - 1. This program using recursivity, shows the disk shifts for a number N of disks given by the user. |