Question: Design and implement a graphical version of the Towers of Hanoi puzzle. Allow the user to set the number of disks used in the puzzle.
Design and implement a graphical version of the Towers of Hanoi puzzle. Allow the user to set the number of disks used in the puzzle. The user should be able to interact with the puzzle in two main ways. The user can move the disks from one peg to another using the mouse, in which case the program should ensure that each move is legal. The user can also watch a solution take place as an animation, with pause/resume buttons. Permit the user to control the speed of the animation.
Step by Step Solution
3.53 Rating (167 Votes )
There are 3 Steps involved in it
public class TowerFrame extends JFrame private TowerPanel towerViewer Sets up the main GUI public TowerFrame setDefaultCloseOperationJFrameEXITONCLOSE towerViewer new TowerPanelTowerPanelDEFAULTNUMDIS... View full answer
Get step-by-step solutions from verified subject matter experts
