This is a Python implementation of the classic triangle peg solitaire game. The goal of this game is to jump pegs over each other in order to remove them from the board. The final objective is to have only one peg left, preferably in a specific position. This enhanced version provides a graphical visualization of the solution path using images. It also supports deeper search depths to find a solution.
Author: Miguel Ángel Mireles Vázquez (ma.mirelesvazquez@ugto.mx)
- Python 3.x
- PIL (Python Imaging Library)
- Clone this repository:
git clone https://github.com/MAMV3x3/Triangle_Peg_Solitaire_BFS.git- Navigate to the directory:
cd Triangle_Peg_Solitaire_BFS- Install the required dependences:
pip install pillowRun the game using the command:
python TrianglePeg.pyFollow the on-screen instructions:
- Enter the start position using the notation e.g. a1, b2, etc.
- Enter the desired end position using the same notation or use '*' if there's no specific ending position.
- Enter the the maximum depth for the search.
The game will then generate potential solutions and visualize them, showing you the moves needed to reach the goal. If a solution is found, a GIF illustrating the moves will be saved as solution.gif.
Aside from Python 3.x, this game relies on the following external Python libraries:
- PIL (Python Imaging Library) Make sure to install them before running the game.
Contributions are welcome! Please make sure to update the tests as appropriate.

