harikrishna2009 / Chess_Game

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python Chess

A GUI chess game including a simple AI, all written in Python.

Index

  1. About
  2. Demo
  3. Usage
  4. Credits
  5. License

About

This project includes a full chess engine, gui engine, and an AI engine. The AI engine utilizes the minimax and alpha beta pruning algorithms.

Demo

Human vs Human Human vs AI (AI is controlling black)
First full human vs human test run First full human vs AI test run

Usage

To install this project, make sure you have the correct version of Python and Pygame. Certain versions of pygame are no longer supported on macOS Catalina.

Installation

  • Switch to Python3.
  • Follow the code below to create virtual environment and install the necessary libraries. (Currently tested on Python 3.7.9 with Pygame 2.0.0dev8 and Python 3.8.2 with Pygame 2.0.0 on macOS Catalina)
git clone https://github.com/boosungkim/python-chess.git
cd python-chess
python3 -m venv venv
source venv/bin/activate
pip install pygame

Commands

  • To start the game, run python3 -W ignore chess_gui.py, then select the game mode you want to play in the command line.
  • To undo a move, press u.
  • To reset the board, press r.

Credits

All three engines were written by Boo Sung Kim, but the move log and the GUI engine code was initially inspired by Eddie Sharick and the AI engine was originally inspired by Sebastian Lague's pseudocode.

Special thanks to Savid for helping me beta test the chess game many times.

License

This project is licensed under the GNU GPLv3 License - see the LICENSE file for details.

About

License:GNU General Public License v3.0


Languages

Language:Python 100.0%