AVA is a simple chess engine for lichess.org. You can play against it on lichess.
Bot uses Lichess-bot. A bridge between Lichess Bot API and bots.
Bot uses a minimax algorithm. It recursively goes through tree of legal moves evaluating the position to determine the best next move. Using Alpha-Beta Pruning it cuts off branches in the game tree which need not be searched because a better move is already available.
NOTE: Only Python 3.7 or later is supported!
- Clone lichess-bot installation guide to install lichess-bot
$ git clone https://github.com/ShailChoksi/lichess-bot.git
$ cd lichess-bot
- Create virtual environment and install all dependencies
$ python3 -m venv venv # If this fails you probably need to add Python3 to your PATH.
$ virtualenv venv -p python3 # If this fails you probably need to add Python3 to your PATH.
$ source ./venv/bin/activate
$ python3 -m pip install -r requirements.txt
- Copy
config.yml.defaulttoconfig.yml - Add python scripts from this repo to
enginesdirectory
AVA_engine.pybonuses.py
- In
strategies.pyimportplayfrommain.pyand add
class AVAChessEngine(MinimalEngine):
def search(self, board, timeLeft, *args):
return PlayResult(play(board, timeLeft), None)- In the
config.yml, change the engine protocol tohomemade - In the
config.yml, change the name fromengine_nameto the name of your class- In this case, you could change it to:
name: "AVAChessEngine"
- In this case, you could change it to:
After activating the virtual environment created in the installation steps (the source line for Linux and Macs or the activate script for Windows), run
$ python3 lichess-bot.py
The working directory for the engine execution will be the lichess-bot directory. If your engine requires files located elsewhere, make sure they are specified by absolute path or copy the files to an appropriate location inside the lichess-bot directory.
To output more information (including your engine's thinking output and debugging information), the -v option can be passed to lichess-bot:
$ python3 lichess-bot.py -v
Create a challenge and enjoy!
All bugs, feature requests, pull requests, feedback, etc., are welcome. Create an issue