Figura: The input configuration file Problem.txt
To execute the program it is necessary to download the 2001-02-PegSolitaire.zip file below and to expand it in some directory. In the "bin" directory there will be a file called PegSolitaire.jar. If there is a "Java Runtime Environment" already installed then it is only necessary to double click the PegSolitaire.jar file. The program will read the "Problem.txt" file automatically. To see the execution of the program I recommend to open a DOS window, to go to the "bin" directory and to execute java -jar PegSolitaire.jar.
Figura: Reading the Problem.txt file and execution of the program. |
When the window appears there will be two buttons "Start" and "Stop." Obviously, the "Start" button begins the search for a solution.
Figura: Control window. |
During the search for a solution the program show how many possibilities have been analyzed.
Figura: Control window. |
To stop the search for a solution it is only necessary to click on the "Stop" button. If the program finds a solution then he will create a "Solution.txt" file with the indication of each movement of the solution.
Figura: Execution of the program. |
|