Skip to content

Repository files navigation

Chess-Bot: Your Personal Chess Grandmaster & Coach

PyChess AI is an offline, distraction-free chess application powered by the Stockfish engine and a professional analysis suite.
Built with Python and a sleek dark-mode UI, it turns your desktop into a personal chess dojo — a place to play, analyze, and improve anytime, without needing an internet connection.


🧩 Features

Play

  • Challenge the world-class Stockfish engine with customizable difficulty levels
  • Smooth, intuitive controls
  • Automatic opening recognition
  • Customizable board themes and sound effects
  • Clean, immersive dark-mode interface

Analyze

  • Post-game analysis with no ads or clutter
  • Blunder detection and best-move suggestions
  • Evaluation graph visualization
  • Tactical threat detection shown directly on the board

Learn & Explore

  • Replay every move with full move history
  • Explore “what-if” move variations
  • Interactive game review to improve pattern recognition and strategic insight

🖼️ Screenshot

PyChess AI Screenshot


⚙️ Installation & Setup

Follow these steps to install and run PyChess AI.
Each step includes what to do and why it’s required.


1. Clone the Repository (Download the Project Files)

This downloads the entire project to your computer.

git clone https://github.com/your-username/Chess-Bot.git
cd Chess-Bot

2. Install Dependencies (Required Python Libraries)

PyChess AI uses several external libraries.

Create a file named requirements.txt containing:

python-chess
PyQt5
pyqtgraph
qdarkstyle

Install everything using:

pip install -r requirements.txt

3. Set Up Stockfish (The Chess Engine)

PyChess AI requires the Stockfish engine for all calculations.

  1. Download Stockfish from the official website
  2. Create a folder named stockfish/ in the project root
  3. Place the Stockfish executable (e.g., stockfish.exe) inside that folder

The app automatically detects the engine at runtime.


4. Add Additional Assets (Optional Enhancements)

  • openings.bin — Polyglot opening book (improves opening play)
  • chess.ico — optional icon for the application

Place these inside the assets/ directory.


🚀 Usage

Run the application using:

python main.py

Select your color and difficulty, play your match, and click Analyze Game afterward for full engine analysis.


💻 Optional: Build a Standalone Windows .exe

To create a portable Windows executable:

pyinstaller --onefile --windowed --icon=assets/chess.ico \
  --add-data "assets;assets" \
  --add-data "stockfish;stockfish" \
  --add-data "config.ini;." \
  main.py -n PyChessAI

Your packaged app will appear in:

dist/PyChessAI.exe

You can run or share this file like any standard Windows application.

About

Chess Bot is a Python application that lets users play chess against the Stockfish AI through a PyQt5 graphical interface. It includes move analysis with evaluation graphs, automatic puzzle generation from mistakes, and an opening trainer, providing an engaging and educational chess experience.

Resources

Stars

7 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages