Tower of Hanoi
Drag the discs yourself, or let it solve the whole thing.
BeginnerWeb appGame5–12hAI-buildable 5/5no setup
The classic puzzle with drag-and-drop, plus an auto-solve that animates the recursive solution move by move. Playing it and then watching the recursion play it is a genuinely good way to understand the algorithm.
UI
Logic
Useful
Hosting · Free forever
Deploys free on GitHub Pages, Cloudflare Pages or Vercel Hobby.
Deploy it and share a link.
Core features · 7
- Three pegs with a configurable number of discs
- Discs drag between pegs
- Illegal moves are rejected with clear feedback
- Move count shows alongside the known minimum
- An auto-solve animates the recursive solution
- Auto-solve can be paused, stepped and resumed
- A win state triggers when the tower is rebuilt
The interesting part
- Turning the recursive solution into a pausable step sequence
- Drag-and-drop that also works by tapping source then destination
Once it works
- Add undo
- Show the recursion tree as it solves
- Add a four-peg variant
Suggested stack
reacttypescripttailwindframer-motion