This site requires JavaScript, please enable it in your browser!
Greenfoot back

Report as inappropriate.

danpost
danpost presents ...

2013/12/21

Tower of Hanoi

TOWER OF HANOI

A puzzle where by moving one ring (or disk) at a time from peg to peg and having no ring placed on a larger ring, the entire stack of rings is moved to a different peg.

Manual and Auto modes. In auto mode, the current state is used to determine what move to execute next.

Three to eight ring range.

Changing manual/auto mode or number of rings resets the puzzle.

4876 views / 16 in the last 7 days

4 votes | 0 in the last 7 days

Tags: with-source puzzle danpost hanoi tower_of_hanoi

This scenario is a member of: Puzzles by danpost


open in greenfoot
Your browser is ignoring the <APPLET> tag.
A new version of this scenario was uploaded on Sun Dec 22 00:00:35 UTC 2013 Finished basic documentation.
danpostdanpost

2013/12/22

Still needs completion detection.
kiarockskiarocks

2013/12/22

So, it takes 2^(n)-1 moves to do it most efficiently. Cool.
A new version of this scenario was uploaded on Sun Dec 22 01:29:37 UTC 2013 Added completion code. Big plus: simplified auto movement code!
danpostdanpost

2013/12/22

@kiarocks, that right. Refer to the discussion "On 'Tower of Hanoi' puzzle algorithm" -- http://www.greenfoot.org/topics/5099
VenbhaVenbha

2017/8/26

nice
A new version of this scenario was uploaded on 2020-10-29 10:06:22 UTC

Want to leave a comment? You must first log in.

Who likes this?

Jeph natca33 Entity1037 kiarocks