A UCI chess engine written in C.
- 120-square mailbox board representation with piece lists
- Pawn bitboards with precomputed set/clear masks
- Zobrist hashing for position keys and repetition detection
- Pseudo-legal move generation validated by perft
- Iterative deepening alpha-beta search with quiescence
- Move ordering: PV move, MVV-LVA, killer moves, history heuristic
- Principal variation hash table
- UCI protocol with time management
make # release build -> ./weebce
make debug # debug build with ASSERT checks enabled
make cleanWith Nix:
nix build # result/bin/weebce
nix develop # dev shell with gcc + makeweebce speaks UCI; point any UCI-compatible GUI (cutechess, Arena,
en-croissant, ...) at the binary, or drive it by hand:
position startpos moves e2e4
go depth 6
Move generation is verified against the standard perft suite in
src/perfsuite.epd (FEN positions with known node counts at depths 1-6).
| File | Purpose |
|---|---|
src/chess-engine.h |
shared types, constants, macros |
src/board.c |
board state, FEN parsing |
src/genmove.c |
move generation |
src/makemove.c |
make/unmake move |
src/attack.c |
square attack detection |
src/search.c |
alpha-beta + quiescence search |
src/evaluate.c |
material + piece-square evaluation |
src/pvtable.c |
principal variation table |
src/uci.c |
UCI protocol loop |
src/perft.c |
perft move-generation testing |