This is a chess engine implemented in Python using the python-chess library. The engine uses a depth-limited negamax algorithm with alpha-beta pruning for move selection, and a simple evaluation function that considers material, mate opportunities, and opening position.
- Supports the Universal Chess Interface (UCI) protocol for communication with chess GUIs
- Handles basic UCI commands like
uci,isready,position,go,ucinewgame, andquit - Implements a negamax search algorithm with alpha-beta pruning
- Simple evaluation function based on material, mate opportunities, and opening position
- Configurable search depth (default is 4 ply)
- Install the required dependencies:
pip install python-chesspip install pyinstaller - Create an executable file
pyinstaller --onefile chessbot.py - Or, you could directly download the executable file from Soham's repository
- Add the executable as an engine in PyChess.
- The engine will now start listening for UCI commands. You can interact with it using a compatible chess GUI (like PyChess)
uci: Tells the engine to use the UCI protocol.isready: Checks if the engine is ready to receive commands.position [fen <fen-string> | startpos] [moves <move1> <move2> ...]: Sets the position on the board.go [infinite | depth <depth>]: Starts calculating the best move.ucinewgame: Resets the game and clears the move history.quit: Quits the engine.
Contributions are welcome! Please open an issue or submit a pull request.