Skip to content

Implementation of chess in python created mainly by following a step-by-step YouTube tutorial by Eddie Sharick.

License

xHarshit/Chess-with-AI

Repository files navigation

♟️ Chess with AI

Chess with AI: A Python-based chess engine and interactive board designed with a simple, intuitive interface and a challenging AI opponent. Built using Pygame, this project lets you experience both player vs player and player vs AI modes directly on your machine.

GitHub license GitHub issues GitHub stars


🧠 Smart Chess Engine

This chess engine utilizes the Minimax algorithm with Alpha-Beta Pruning, giving it the ability to make calculated and strategic decisions. It evaluates all possible outcomes to select the most optimal move—providing a solid challenge to even experienced players.


📸 Visual Preview

Screenshot 1
Gameplay

Screenshot 2
AI Thinking

Screenshot 3
Match End


🚀 Features

  • 🧩 AI Opponent: Based on Minimax with Alpha-Beta Pruning.
  • 🎮 Game Modes: Player vs Player, Player vs AI.
  • 👆 Clickable Interface: Click to select and move pieces.
  • 🕹️ Undo / Reset: Easily undo moves or restart the game.
  • 📋 Move Logger: Track every move made in the session.
  • ♟️ Realistic Movement: Enforces legal moves and game rules.

🛠️ Tech Stack

  • Python 3
  • Pygame

📂 Project Structure

Chess-with-AI/
│
├── ChessMain.py         # Main game loop and UI
├── ChessEngine.py       # Core logic for move generation and validation
├── ChessAI.py           # Minimax-based AI logic
├── images/              # Game assets (pieces, board)
├── screenshots/         # Project preview images
├── requirements.txt     # Dependencies (Pygame)
├── LICENSE              # MIT License
└── README.md            # You're here!

⚙️ Getting Started

Follow these steps to set up the project locally:

git clone https://github.com/xHarshit/Chess-with-AI.git
cd Chess-with-AI
python -m pip install -r requirements.txt
python ChessMain.py

🎮 Controls

  • Press Z → Undo last move
  • Press R → Reset the game
  • Click → Select and move pieces

🧩 Future Enhancements

  • Improve AI with move ordering and opening book
  • Implement drag-and-drop piece movement
  • Add board flip and dark mode options
  • Enhance UI with piece skins and animations

📄 License

This project is licensed under the MIT License. Feel free to use and modify it for your own learning or projects. ;)

About

Implementation of chess in python created mainly by following a step-by-step YouTube tutorial by Eddie Sharick.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages