Tower of HANOI puzzle (Solve or Play) Select how many discs (3-7) you want, then Click the Green Flag or the [Tower of Hanoi] project Title button. To play Hit a pair of onscreen letter Buttons or Keys (FROM-TO) being A-B, A-C, B-A, B-C, C-A or C-B. Or Click any Disc already on a Peg to select that Peg. Impossible, pointless (A-A) or illegal (placing a disc on top of a smaller one) moves won't be allowed. Or get it solved for you by clicking the "Solve It" button. NOTE: your aim should be to try to solve the puzzle in the pre-calculated minimum number of Moves, which of course the [Solve It] button will always do.
Created by @gregatku for use in Coding Classes for Kids Unlimited, for whom I work as a Coding teacher. Makes great use of broadcast, list variables, clones & code blocks with input, highlighted by the elegant Recursive code for solving the puzzle (Solve It sprite). April 2021 Update: - Redrew Disc costumes with 3.0 Vector Mode Drawing - Added Letter Button sprites to make it Mobile friendly - Fixed a 4-yo Bug: the sideways Glide was ineffective - Removed 6 of the 7 Disc sprites - Now just one Disc sprite with (Discs) clones - Redrew Base & Pegs using same technique as Discs Drawn in by @papipupepappa's 100% Pen Hanoi Puzzle project (with up to 10 discs & 6 pegs) - https://scratch.mit.edu/projects/513313887/, I decided to make a 4 Disc version, otherwise known as Reve's Puzzle - https://scratch.mit.edu/projects/515288256/. It's somewhat trickier to work out how to solve it in the minimum number of moves, but obviously with 2 spare pegs to work with it will take considerably less moves.