Choose the number of pegs and discs, and click start. Then try to move the discs to the rightmost peg (marked with a dot) with as few moves as possible. Click and drag to move a disc. Rules: ● You can only move one disc at a time. ● You cannot place a disc on a smaller disc.
Huge thanks to @gregatku who inspired me to make this, both with his own Tower of Hanoi project and many supportive comments: https://scratch.mit.edu/projects/133945156/ My biggest trouble when making this was trying to figure out an algorithm for getting the fewest possible moves for any number of discs and pegs. I soon discovered the Frame–Stewart algorithm, but I couldn't quite figure it out: https://en.wikipedia.org/wiki/Tower_of_Hanoi#Frame%E2%80%93Stewart_algorithm But I also found a 2004 paper by Ben Houston and Hassan Masum called "Explorations in 4-peg Tower of Hanoi", which was very useful to me (see the Minimum Moves Calculator sprite for more about that): http://service.scs.carleton.ca/sites/default/files/tr/TR-04-10.pdf The Mathologer video "The ultimate algorithm" was also very very helpful: https://youtu.be/MbonokcLbNo The sounds are all from the Scratch library, although some are edited beyond recognition.