https://github.com/pawel-parma/peg-solitaire
Peg solitaire game written in python
https://github.com/pawel-parma/peg-solitaire
app application customtkinter customtkinterprojects game game-development gamedev peg-solitaire python python-3 python3
Last synced: 10 months ago
JSON representation
Peg solitaire game written in python
- Host: GitHub
- URL: https://github.com/pawel-parma/peg-solitaire
- Owner: Pawel-Parma
- License: agpl-3.0
- Created: 2023-09-07T13:08:32.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-23T20:46:53.000Z (about 1 year ago)
- Last Synced: 2025-03-23T21:31:04.794Z (about 1 year ago)
- Topics: app, application, customtkinter, customtkinterprojects, game, game-development, gamedev, peg-solitaire, python, python-3, python3
- Language: Python
- Homepage:
- Size: 438 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.adoc
- License: LICENSE.md
Awesome Lists containing this project
README
= Peg Solitaire
Simple peg solitaire game written in python using customtkinter library.
== Run
- Install dependencies
pip install -r requirements.txt
- Run the game
python -m src.main
== Game
=== Example:
image::examples/game1.png[900, 562]
{empty} +
To get the rules of the game, click on the `Rules` button in the upper left corner.
Fill the board with pegs then press `Play` to start the game. +
Select a peg and click on the destination cell to move the peg.
You can:
[disk]
- restart the board by pressing the `Restart` button. +
- save the current board by pressing the `Save` button. +
- load a saved board by pressing the `Load` button. +
- get solution by pressing the `Solution` button. +
- solve the board by pressing the `Solve` button. +
- undo the last move by pressing the `Undo` button or `ctrl + z`. +
- redo the last move by pressing the `Redo` button or `ctrl + y`. +
=== How the solution notation works:
For example let's take solution of the previously shown board: +
image::examples/game1-solution.png[900, 562]
{empty} +
We will discuss the first move of the solution `C7D`: +
The first two characters `C7` represent the peg that will be moved. +
The last character `D` represents the direction of the move.
The direction is represented by the following characters:
[disk]
- `U` for up +
- `D` for down +
- `L` for left +
- `R` for right +