Description of what the program is to do


Description

Create a 2D (preferably 3D) board of the peg solitaire puzzle. The board has a triangular shape and its dimension is 5x5x5. The board has 15 holes all occupied by 15 pegs. The first peg is removable as the user's clicking on the peg.

The rule of the game is simple: once a peg is taken out by clicking on it, moves can be executed. A legal move is to jump a peg orthogonally over an adjacent peg into a hole that is two positions away and then remove the jumped peg. The goal of the game is to remove all the pegs except one. The goal of the program is to display the solution for the chosen puzzle.

The user takes the first peg out, and then the solver starts solving the puzzle. The jumped pieces will be removed from the screen. The puzzle will stop when there is only one piece remains on the board. The user has an option to repeat the process.

Its graphical representation is directed by a set of moves generated by the solver. The solution is displayed one step at a time. User can use keyboard to change the view angles.


Back to Homepage