Download the 5 sprites and 19 scripts of "Hanoi2_mlf2a4" and open it in Scratch
Project Notes
This is a tower of hanoi that knows how to solve itself. It is part of the 'Taste of ...' series at http://chimu.wordpress.com/a-taste-of-scratch
Scratch is an unusual language to program the Tower of Hanoi in because it is missing procedures and recursion. But because of those restrictions, Scratch produces a very interesting and Object-Oriented result. It actually delegates to the Disks better than implementations in other languages like Smalltalk/Squeak or Ruby might choose to do.
Comments are in the Stage and the Sprite1 sprite. If you change Sprite1, simply delete the other sprites and set their disk-id appropriately. Sprite1 is the prototype for all the other Sprites (kind of like a 'class' but instance-based. See JavaScript, Self, etc. for examples).
Comments
You need to be logged in to post comments
Add a Comment
0.0 amazing!