ChessP2P is a peer-to-peer (P2P) chess game implemented in Python that enables you to play chess with others by directly connecting to their IP address. With ChessP2P, you can play chess matches with people connected to your local network.
To start playing chess with ChessP2P, follow these steps:
-
Clone the Repository:
git clone https://github.com/yourusername/chessP2P-python.git
-
Navigate to the Directory:
cd chessP2P
-
Install Dependencies:
pip install -r requirements.txt
-
Run the Application:
python3 chessP2P.py
-
Connect to an Opponent:
- Share your IP address with your opponent, or obtain their IP address.
- Enter the opponent's IP address into the challenge section of the ChessP2P application to establish a connection.
- Wait for your challenge to be accepted, or cancel it.
-
Enjoy Your Chess Match!
ChessP2P offers the following features:
- Peer-to-Peer Chess: Play chess with other players directly by entering their IP address.
- Decentralized: ChessP2P does not rely on central servers or third-party services.
-
Challenge Friend: Enter your friends IP address and a message for them if you want to. Wait for accept or enter something to cancel.
-
View Incoming Challenges: Shows your most recent challenges. Only the most recent challenge per IP.
-
Exit: Exits the application cleanly, same as
Ctrl+C
.
ChessP2P follows the standard rules of chess. In order to make a move, follow these steps:
-
Make a move: Type the coordinates of the piece you want to move and the square you want to move to. Eg.
e2e4
-
Special Moves:
- En Passant: To capture with en passant simply capture the empty square behind the pawn. Capturing en passant would look something like this
e5d6
- Castling: Enter
O-O
for a king side castle orO-O-O
for a queen side castle. - Pawn Promotion: Enter your move, followed by the symbol of the piece to promote to. Queen 'Q', Bishop 'B', Knight 'N', Rook 'R'. Eg.
e7e8Q
would promote your pawn to a queen if you were playing white. ChessP2P supports special moves such as castling and en passant. When these moves are possible, the interface will provide options to execute them.
- En Passant: To capture with en passant simply capture the empty square behind the pawn. Capturing en passant would look something like this
-
Check, Checkmate, and Stalemate: You will receieve a message saying "Check!" when a check occurs. The game will end in the event of checkmate or stalemate and you will be informed of what happened.
-
Resign: To resign from the game, simply type quit when it is your turn. Alternatively you can
Ctrl+C
at any time to stop the app.
We welcome contributions from the open-source community to improve ChessP2P. If you'd like to contribute, please follow these guidelines:
- Fork the repository.
- Create a feature branch:
git checkout -b feature/your-feature
. - Make your changes and commit them:
git commit -m 'Add your feature'
. - Push to the branch:
git push origin feature/your-feature
. - Submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.
Enjoy playing chess with ChessP2P, and have fun strategizing with your opponents! If you encounter any issues or have suggestions for improvement, please feel free to open an issue or contribute to the project.