Skip to content

ucsb-cs56-projects/cs56-games-towers-of-hanoi

Repository files navigation

cs56-games-towers-of-hanoi

project history

 YES | mastergberry | amwexler | (jstaahl) A towers of hanoi GAME (not a solver or a simulation or an animation of the algorithm!)

 W14 | bkiefer13 5pm | amwexler | (jstaahl) A towers of hanoi GAME (not a solver or a simulation or an animation of the algorithm!)

A command line towers of hanoi game---not just a simulation, but a GAME

Launching the Game

To launch the game using the command line, simply use the command:

ant run

When prompted by ant for the input-runargs, type in the number of starting disks you would like there to be and hit enter.

To launch the game using the GUI, simply use the command:

ant run-GUI

Description

ASCII Version

Instructions for ASCII Version

At each step, the game displays an ASCII representation of the current state of the towers. To move a disk from one tower to another, the user types in the start tower number and the end tower number separated by a space.

The game counts the user's moves. When the user completes the puzzle, the game tells the user how many moves it took him/her, as well as how many moves the optimal solution would have been.

GUI Version

When game is first run. Menu frame pops up with a Play Button, Continue Button, Settings Button, and Exit Button.

Play Button

When play button is first clicked an Instructional window pops up like the one shown below.

If you would like to continue playing the game after reading the instruction click yes. Else if you would like to go back to the main menu click no.

After you have clicked yes. A new window will pop up asking you to enter how many disks you want each tower to have. The minimum is 3. When you have entered a valid number, click "Play". But if you would like to go back to the main menu click "Done".

Once you click play the game window pops up. You are given a timer on top that continues to run until you are finished or pause the game.You are also given some instructions on the bottom part of the window. Everytime you click a tower the topmost block is highlighted with a particular color. Color of blocks can be changed in the settings button which is located in the main menu.

There is also an options button that will pause the game, and allow you to reset the game and take you to the main menu, a help button that gives you instructions of the game and save button that allows you to save the game data and a continue button to start the timer again and continue playing.

If you make an illegal move, the game provides an alert. Tap the spacebar to dismiss it.

Upon completion, the game provides feedback.

Continue Button

When clicking the Continue button you are able to continue the last game state that you have saved after saving the game on the game frame using the options button. Then pick the load state you want to continue from.

Setting Button

When clicking the settings button you can change many features such as the shape of the block, the color or texture of the block, turn music on or off, and turn the instructions on or off. After changing each feature on the settings frame you must make sure to click the save button before exiting out of the frame.

Instructions for GUI Version

When the game starts, so will the timer. Click on a tower to select its top disk and then click on another tower to move that disk there. Move all three disks to another tower to win the game.

GUI Audio

Because we included audio into the GUI version of this game, this game will not run through ssh but works perfectly fine on local computer or on CSIL computers (without ssh).

Javadoc

Javadoc is available at here

F16 Final Remarks

This version of Tower of Hanoi game fulfils the basic requirement for a game, which has features like save and load, change of color of the blocks, pause and resume, restart, and instructions. However, there are some bugs exist in the current system. When the player pauses the game, just the timer pauses, which means that the player can still play with the blocks. This should not happen for a real pause, and should be fixed in later version.

Moreover, there are two features can be improved, save and load, and the graphics of the tower. In current version, only one game can be saved and it can be improved to have multiple game saved in same time and load by the choice of players.For the graphics, different skins of disks and the background of the tower are prefered.

F17 Final Remarks

F17 removed the bugs of when the player pauses the game, just the timer pauses, which means that the player can still play with the blocks. We also added the option to continue from three past saves and choose from three different textures.

An additional GUI could be added to let the user write its own file and choose the file Name. There could also be additonal textures added as there was only three added.

Current bugs that still exist are the move count setting to 0 from a continued game. The bug can be reprouduced by playing a new game, moving at least one disk and saving the game. Then from the main menu, continue the saved game. The move count will show '0' then updates to the correct move count once a disk is moved.