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.

2624 views / 10 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 does not support the canvas 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

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

Who likes this?

Jeph natca33 Entity1037 kiarocks