A robust chess engine implementation built using Minimax and Alpha-Beta Pruning algorithms. This engine evaluates positions heuristically and supports standard chess gameplay features.
- Implements Minimax with Alpha-Beta Pruning for optimal decision-making.
- Supports essential chess rules:
- Castling (Kingside and Queenside).
- En Passant.
- Pawn promotion.
- Threefold repetition
- Fifty-move rule
- Implements a FEN string input option so that you can input your games.
- Utilizes a Polyglot opening book for quick and accurate early-game decisions.
- Includes a command-line interface(CLI) for playing against the engine.
- Python 3.8 or higher.
Clone this repository:
git clone https://github.com/Thanos-png/chess-engine.git
cd chess-engine
To start a game run the following command on your CLI:
python3 main.py
Once the game starts, follow the prompts and choose a depth at which you would like the engine to play.
You can choose any values from 1
to 5
or just press enter
and it will be adjusted automatically.
To choose the color you want to play as you can type w
as well as white
and b
as well as black
Or if you want the engine to play with itself you can press Enter
After you chose the depth and your color you can input your moves.
(e.g., e2 e4
for moving a pawn from e2
to e4
).
Note: You can type fen
as a move if you want to input a specific position using a fen string. Or you can type either r
or resign
if you wish to surrender.
Contributions are welcome! Please feel free to fork the repository and submit a pull request.
- Add a Transposition Table
- Add an Endgame Table
- Bitmap Implementation
For questions or feedback, feel free to reach me out:
- Email: [email protected]