LegalMiniUCI is a simple, single-file chess engine written in C, designed to support the UCI (Universal Chess Interface) protocol. It features iterative deepening, alpha-beta pruning, and basic evaluation with material and positional heuristics.
Note: This engine is still in development. Features, evaluation, and performance may change as the project evolves.
- Singe-file C implementation
- Supports UCI protocol
- Iterative deepening up to user-defined depth.
- Alpha-beta pruning for efficient search
- Simple evaluation with:
- Material values
- Piece-square tables(PSTs)
- Mobility and positional considerations
- PV (principal variation) printing in UCI style
- Cross-platform: works on Windows, Linux, macOS
- Configurable search depth
You can compile manually using your VS Code terminal or any C compiler:
# Using GCC (on Linux / macOS)
gcc -O2 -Wall -Wextra -std=c11 legalminiuci.c -o legalminiuci.exe
# Using MinGW on Windows
gcc -O2 -Wall -Wextra -std=c11 legalminiuci.c -o legalminiuci.exe
For debugging, you can add
-go O0instead of-O2
./legalminiuci.exe # Linux/macOS
legalminiuci.exe # Windows
Then connect it to any UCI-compatible GUI like Arena, Cute Chess, or ChessGUI.
uci– Initialize UCI modeisready– Engine readiness checkucinewgame– Start a new gameposition [fen ...] moves ...– Set position and movesgo [depth ...] [nodes ...] [movetime ...] [wtime ...] [btime ...]– Start searchquit– Exit the engine
uci
isready
ucinewgame
position startpos moves e2e4 e7e5
go depth 5
- Depth 5 works smoothly for normal hardware.
- Engine is single-threaded and designed for simplicity and education.
- For VS Code users, just open the terminal in the folder with
legalminiuci.c andrun the GCC command above.