PraxTube / chess-ai

A chess AI that uses alpha-beta to find the best move
MIT License
0 stars 1 forks source link
ai alpha-beta artificial-intelligence chess chess-ai chess-engine chess-game chessboard python

Chess AI

Basic chess ai that uses alpha-beta to search for the best move on a given board. The max depth is 3, any deeper and the AI will take way to long to compute the best move.

Getting started

Set up the project locally.

Prerequisites

You will need python3 and git. I would recommend python3.10 but others should work too.

Install

The following instructions are for linux. If you don't know how to apply them for your OS (i.e. windows or mac), consider prompting ChatGPT to translate them to your OS.

git clone https://github.com/PraxTube/chess-ai.git
cd chess-ai
python3.10 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
pip install -e .

if everything went well, you should be able to run the project with

python src/chess_ai/main.py

Contributing

How you can add your changes to this repo.

Set up

In order to contribute to this repo, you will need to set up and SSH key for you github account. You can follow these steps here. Note that you will want to change your git remote origin in your chess-ai folder. If you don't know how to do this, then you can simply run git clone git@github.com:PraxTube/chess-ai.git and then follow the steps above to set it up.

Adding a Pull Request

In order to make changes you will need to work on your own branch. Once you created your local branch, you can push it to github. When every task is completed, you can create a pull request. This will get reviewed and after potentially having to fix some issues, your branch will get merged in the master branch.

Conventions

We are using black and flake8 to format our python code. You can run the following commands when you are in you venv

black .
flake8 .

The first one will automatically format you code in-place. If you prefer to see if it would change anything, you can use the flag --check.

CI

This repo uses github actions to automatically run specific tests, see here. These tests will check the following:

if any of these fail, then you will not be able to merge your PR into master. You should check if your commit passed the tests.

Note that your branch will only be tested if you have an open pull request into master.