The Tower of Hanoi

ZX Text (JavaScript)


  • [1], [2], [3], Mouse click - Select one pile;
  • [+], [-] - Change number of discs (1 to 10).

The Legend of The Tower of Hanoi

In the great temple of Brahma in Benares of India, there is a plate with three diamond needles under the dome that marks the center of the world.
At the creation, God placed 64 discs of pure gold in the order of their sizes, from largest to smallest.
This is the Tower of Brahma.
Day and night unceasingly the priests of the temple move the discs from one diamond needle to another according to the fixed and immutable rules listed below;
  • Only one disc can be moved at a time
  • A disc can only be placed on a larger disc (or no smaller disc below)
  • The discs must go all to the third needle
When the all discs are moved from the first needle to the third needle forming the Tower of Brahma, then will come the end of the universe and all will turn to dust.