Duong Pham's CS390 Project Page

"Final Documentations"


Installation

The program must be run on a Linux operating system and requires the use of the terminal. A zip file (PegSolitaire.zip) that contains all the necessary files can be found on the Implementation page. The user will need to download this file and then extract all the files. Once the user has successfully extracted all the files then the user needs to open a terminal and go to the directory that contains the extracted files. Once the user is in this directory then the user needs to run the command "make -f makeFile.pegSolitaire" so that the computer will compile the program and create an executable file. Note that the computer needs to have GLUT library installed in order to compile the source code. The computer should now have two executable files of the peg puzzle. One file is "peg" that is the graphical version and the other file is "PegPuzzleSimulation" that is a text version. Then the user can run the program as they please.

Running the Program

The user needs to locate the executable file for the program through the terminal. Once the user has found the executable file, the user needs to use the command "./peg" for the graphical version or "./PegPuzzleSimulation" for the text version. This command will execute the program and then the user is ready to interact with the peg puzzle game. The graphical version will show:

The text version will show:

Instructions on using the program

Text Version
When the text version first loads, the user is asked to type in a coordinate of the location that they would like to remove a peg at for the starting location. Once the user has entered a coordinate the program will automatically display information related to the solution. The program first displays a string containing the move and then displays a text based representation of the new board. Once the entire solution has been displayed the user is allowed to type in a new coordinate or can type in "exit" to exit the program. If the user types in an incorrect coordinate then the program will just inform the user that it is an invalid starting location and allows the user to try entering in a different coordinate.

Graphical Version
When the graphical version first loads, the user will see a triangular peg puzzle board with all fifteen holes filled by pegs. The user will then need to select a peg by clicking on that peg which should be removed to obtain a starting configuration. The program will then instantly begin to find a solution and start displaying the moves in the solution. During the play back, the user can change the view by pressing keys "1" "2" "3" and "4". By pressing these key, the user can move to the pre-designated spots to look at the board. The user can also change the view manually by press the key "p" to pause the solving process, and then use the arrow to look up, down, left, right, press "f" to zoom in and "b" to zoom out, "d" to rotate the board to the left and "g" rotate the board to the right. Pressing the key "q" will quit the puzzle. When the puzzle is solved, the program will stop executing any move. At this point, the user can press "r" to generate a new board and repeat the process.

 


Back to Homepage