A UCI chess engine written from scratch in C++. Hosted on GCP and rated ~2000 on Lichess.
Play against Archduchess on Lichess!
This project uses CMake
- CMake >= 3.30
- A C++20 compatible compiler (e.g., GCC, Clang, MSVC)
- Release: Optimized for speed, disables debug info.
- Debug: No optimizations, includes debug symbols, extra warnings.
- Profile: Optimized for profiling, disables PIE, enables profiling flags.
From the root folder
sh build.shThe script accepts the following parameters:
| Parameter | Description | Default |
|---|---|---|
release / debug / profile |
Choose build preset | release |
--test |
Run tests after building | false |
--clean |
Delete the build directory before configuring and building | false |
From the root folder
-
Configure the project:
cmake --preset <configure-preset-name>
Replace
<configure-preset-name>with one of- ninja-release
- ninja-debug
- ninja-profile
-
Build the project:
cmake --build --preset <build-preset-name>
Replace
<build-preset-name>with one of- release
- debug
- profile
It has to match what you have chosen at step 1
-
(optional) Run the tests:
ctest --preset <test-preset-name> --output-on-failure
Replace
<test-preset-name>with one of- release
- debug
- profile
It has to match what you have chosen at step 1 and step 2
The engine executable will be in build/<build-type>/bin/archduchess.exe
- uci, isready, ucinewgame, position, go, stop, and quit commands
- go ponder, go searchmoves and go mate are not implemented
- Board representation using bitboards
- Bitboard shift for pawns
- Bitboard masks for knights and kings
- Magic bitboards for sliding pieces
- Generate pseudo-legal moves, then remove illegal moves
- Material count
- Piece-Square Tables
- Negamax
- Alpha-Beta Pruning
- Iterative Deepening
- Aspiration Windows
- Transposition Table
- Quiescence Search
- Delta Pruning
- Null Move Pruning
- Check Extension
- Late Move Reduction
- Best move from the previous iteration
- Hash move from the transposition table
- MVV-LVA
- 2 Killer Moves
- History Heuristic
- Indexed by side to move, start square and end square
- Better evaluation (pawn structure, king safety, endgame piece-square tables, etc...)
- Static Exchange Evaluation
- Late Move Reduction