A Python-based chess engine and game implementation with a minimax AI.
This project implements a chess game with a minimax-based AI engine. It supports standard chess rules, including special moves like castling, en passant, and pawn promotion. The AI uses the minimax algorithm with alpha-beta pruning to evaluate positions and make decisions.
-
Clone the repository:
git clone https://github.com/rishimule/chess_agent.git cd chess_agent
-
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the package in development mode:
pip install -e .
-
Install test dependencies:
pip install -r tests/requirements.txt
Run the main game:
python src/main.py
Run the tests:
PYTHONPATH=src python -m pytest tests/ -v
chess_agent/
├── src/
│ ├── chess/
│ │ ├── engines/
│ │ │ ├── __init__.py
│ │ │ ├── base.py
│ │ │ └── minimax.py
│ │ ├── pieces/
│ │ │ ├── __init__.py
│ │ │ ├── base.py
│ │ │ ├── bishop.py
│ │ │ ├── king.py
│ │ │ ├── knight.py
│ │ │ ├── pawn.py
│ │ │ ├── queen.py
│ │ │ └── rook.py
│ │ ├── ui/
│ │ │ ├── __init__.py
│ │ │ ├── display.py
│ │ │ └── input_handler.py
│ │ ├── utils/
│ │ │ ├── __init__.py
│ │ │ └── move_parser.py
│ │ ├── __init__.py
│ │ └── board.py
│ └── main.py
├── tests/
│ ├── engines/
│ │ ├── __init__.py
│ │ ├── test_base.py
│ │ └── test_minimax.py
│ ├── pieces/
│ │ ├── __init__.py
│ │ ├── test_bishop.py
│ │ ├── test_king.py
│ │ ├── test_knight.py
│ │ ├── test_pawn.py
│ │ ├── test_queen.py
│ │ └── test_rook.py
│ ├── ui/
│ │ ├── test_display.py
│ │ └── test_input_handler.py
│ ├── utils/
│ │ └── test_move_parser.py
│ ├── requirements.txt
│ └── test_board.py
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── requirements.txt
└── setup.py
- Chess Rules: Implements standard chess rules, including special moves.
- Minimax AI: Uses the minimax algorithm with alpha-beta pruning for AI decision-making.
- Comprehensive Tests: Extensive test coverage for all components.
Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.
This project is licensed under the MIT License. See the LICENSE file for details.