Skip to content

SerhiiStets/AVA-chess-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

AVA-chess-engine

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.

Algorithm

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.

Installation

NOTE: Only Python 3.7 or later is supported!

  1. Clone lichess-bot installation guide to install lichess-bot
$ git clone https://github.com/ShailChoksi/lichess-bot.git
$ cd lichess-bot
  1. 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
  1. Copy config.yml.default to config.yml
  2. Add python scripts from this repo to engines directory
  • AVA_engine.py
  • bonuses.py
  1. In strategies.py import play from main.py and add
class AVAChessEngine(MinimalEngine):
    def search(self, board, timeLeft, *args):
        return PlayResult(play(board, timeLeft), None)
  1. In the config.yml, change the engine protocol to homemade
  2. In the config.yml, change the name from engine_name to the name of your class
    • In this case, you could change it to: name: "AVAChessEngine"

Usage

Activating bot

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

Playing against bot

Create a challenge and enjoy!

Contributing

All bugs, feature requests, pull requests, feedback, etc., are welcome. Create an issue

About

A simple chess engine for lichess.org

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages