Chess against a bot
- Clone the repository
- Execute
pip install -t requirements.txt
- Open
main.py
You are playing for white against a bot.
Select a piece and choose one of valid moves (they will be highlighted with green circles)
This project is a chess game against a bot written using the mini-max algorithm and alpha-beta puring optimization.
The bot evaluates positions in which knights and pawns are in the center of the board higher, which allows him to play
relatively well in the opening
knight_value = [[2.5, 2.7, 2.8, 2.8, 2.8, 2.8, 2.7, 2.5],
[2.7, 2.8, 2.9, 2.9, 2.9, 2.9, 2.8, 2.7],
[2.8, 2.9, 3.0, 3.0, 3.0, 3.0, 2.9, 2.8],
[2.8, 2.9, 3.0, 3.0, 3.0, 3.0, 2.9, 2.8],
[2.8, 2.9, 3.0, 3.0, 3.0, 3.0, 2.9, 2.8],
[2.8, 2.9, 3.0, 3.0, 3.0, 3.0, 2.9, 2.8],
[2.7, 2.8, 2.9, 2.9, 2.9, 2.9, 2.8, 2.7],
[2.5, 2.7, 2.8, 2.8, 2.8, 2.8, 2.7, 2.5]]
bishop_value = [[2.7, 2.85, 2.85, 2.85, 2.85, 2.85, 2.85, 2.7],
[2.85, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 2.85],
[2.85, 3.0, 3.05, 3.05, 3.05, 3.05, 3.0, 2.85],
[2.85, 3.0, 3.05, 3.1, 3.1, 3.05, 3.0, 2.85],
[2.85, 3.0, 3.05, 3.1, 3.1, 3.05, 3.0, 2.85],
[2.85, 3.0, 3.05, 3.05, 3.05, 3.05, 3.0, 2.85],
[2.85, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 2.85],
[2.7, 2.85, 2.85, 2.85, 2.85, 2.85, 2.85, 2.7]]
pawn_value = [[1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1.05, 1.05, 1, 1, 1],
[1, 1, 1, 1.35, 1.35, 1, 1, 1],
[1, 1, 1, 1.35, 1.35, 1, 1, 1],
[1, 1, 1, 1.05, 1.05, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1]]
Thank you for your interest in my project!