luccabb / lazy_smp

Didactic Python Chess Engine that implements: Negamax, PeSTO’s Evaluation, Null Move, Quiescence Search, Lazy SMP.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Didactic Python Chess Engine

Installing dependencies

pip install -r requirements.txt

Running the Engine

1. Running as an UCI Compatible Engine

# to get available options
$ python main.py --help
# starts the engine with default options
$ python main.py

2. Running as a Web Server

python api.py

Running Tests

Unit Tests

Unit tests are testing the basic functionality of the engine, with key positions and moves.

python -m unittest tests/test.py

Bratko-Kopec tests the engine performance in terms of time and strenght.

python -m tests.test_bratko_kopec

Lichess-bot Python Bridge

This engine implements the UCI protocol and can be used as a bot on Lichess. You can use the python bridge between Lichess Bot API and the engine: https://github.com/ShailChoksi/lichess-bot.

To run it as a bot you'll need to produce a python executable. PyInstaller can produce it by running the following command:

python3 -m PyInstaller main.py

This creates a build and dist folder. The dist folder contains the main executable in a folder called main. All the files inside main need to be copied over to /lichess-bot/engines for it to work. You can checkout /lichess for further lichess setup.

About

Didactic Python Chess Engine that implements: Negamax, PeSTO’s Evaluation, Null Move, Quiescence Search, Lazy SMP.

License:MIT License


Languages

Language:Python 96.6%Language:Shell 3.4%