Chal
A complete, FIDE-rules-compliant chess engine written in 999 lines of C99 with zero external dependencies.
The name is Gujarati for “move.” The project was built as a personal challenge to see how far a readable, fully rule-compliant chess engine could go within a strict 1,000-line constraint. It currently achieves a CCRL rating of 2750+.
Key Features
- Full Rule Compliance: Unlike many minimal engines, it implements en passant, all underpromotions (knight, bishop, rook), castling rights, repetition detection, and the 50-move rule.
- Classic Chess Engine Architecture: Uses a
0x88board representation, transposition tables with Zobrist hashing, and a dedicated capture generator for quiescence search. - Search & Evaluation: Implements iterative deepening, alpha-beta search with null move pruning, aspiration windows, history heuristics, and a basic material/positional evaluation.
- Readable Source: The codebase is split into 13 self-contained sections, written to be read top-to-bottom in a single sitting without complex abstractions.