A modern, interactive implementation of the classic Tower of Hanoi puzzle game built with HTML, CSS, and JavaScript. Created with assistance from Trae AI.
Give it a try: https://towerofhanoi.t0biii.dev/ or https://t0biii.github.io/TowerofHanoi/
- Drag and drop interface
- Customizable number of disks (3-6)
- Move counter with minimum moves display
- Dark/Light theme toggle
- Celebration animation on completion
- Responsive design
- Local theme preference storage
- Objective: Move all disks from the leftmost tower to the rightmost tower
- Rules:
- Only one disk can be moved at a time
- A larger disk cannot be placed on top of a smaller disk
- Only the top disk of any tower can be moved
- Open
index.html
in a web browser - Select the number of disks (3-6) using the dropdown
- Drag and drop disks between towers
- Try to complete the puzzle in the minimum number of moves
- Pure HTML, CSS, and JavaScript implementation
- No external dependencies except for the confetti animation
- Responsive design that works on both desktop and mobile devices
- Local storage for theme preferences
The minimum number of moves required to solve the puzzle is: 2ⁿ - 1 where n is the number of disks.
- 3 disks: 7 moves
- 4 disks: 15 moves
- 5 disks: 31 moves
- 6 disks: 63 moves
Built with assistance from Trae AI