This is a simple command-line based Chess game implemented in Python. It includes the game logic, piece movements, and basic user interface for playing chess.
-
Clone the repository to your local machine:
git clone https://github.com/jayy1511/Chess-game-in-Python.git
-
Navigate to the project directory:
cd Chess-game-in-Python -
Run the main file to start the game:
python main.py
- Full Chess Game: Play a complete game of chess against another player on the command line.
- Piece Movement: Implementations for all chess pieces (Pawn, Rook, Knight, Bishop, Queen, King) with valid moves.
- Check and Checkmate Detection: Detects when a player is in check or checkmate.
- Run the
main.pyfile. - Enter the source position (e.g., a2) and destination position (e.g., a4) to move a piece.
- Play alternates between white and black pieces.
- The game continues until a player is in checkmate.
- ChessBoard.py: Contains the
Gameclass which represents the chess board and game logic. - Piece.py: Contains implementations for all chess pieces (Pawn, Rook, Knight, Bishop, Queen, King).
- main.py: Main file to run the chess game and handle user input.
- test_Game.py: Unit tests for the chess game logic.
- test_Piece.py: Unit tests for the chess pieces.
Unit tests are provided to ensure the correctness of game logic and piece movements. To run the tests:
python -m unittest