Skip to content

boosungkim/custom-chess-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Custom Chess Engine

A chess engine written from scratch, including single player mode and multiplayer mode, written using Python. A C++ implementation is slowly in the works.

kandi X-Ray kandi Featured

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. As mentioned, a C++ implementation is slowly in the works.

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

A chess game built from scratch in Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published