Skip to content

A Python-based chess engine that implements a full-featured chess game with a minimax AI, supporting standard rules and special moves, while ensuring reliability through comprehensive tests.

License

Notifications You must be signed in to change notification settings

rishimule/chess_agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chess Agent

A Python-based chess engine and game implementation with a minimax AI.

Overview

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.

Installation

  1. Clone the repository:

    git clone https://github.com/rishimule/chess_agent.git
    cd chess_agent
  2. Create a virtual environment and activate it:

    python -m venv venv
    source venv/bin/activate  # On Windows, use `venv\Scripts\activate`
  3. Install the package in development mode:

    pip install -e .
  4. Install test dependencies:

    pip install -r tests/requirements.txt

Usage

Run the main game:

python src/main.py

Run the tests:

PYTHONPATH=src python -m pytest tests/ -v

Project Structure

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

Features

  • 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.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

A Python-based chess engine that implements a full-featured chess game with a minimax AI, supporting standard rules and special moves, while ensuring reliability through comprehensive tests.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages