- build 2024.11
- stack · 5 components
- published 2024-11-07
CChess
Small, direct engine work in C. Explicit state, deterministic search, and code you can actually follow.
- 01Language
- Pure C
- 02Domain
- Chess engine
- 03Core techniques
- Minimax, alpha-beta pruning, and evaluation heuristics
- 04Footprint
- Small enough to keep in your head
why it matters
- Bitboards keep board state compact and make move operations bitwise.
- Alpha-beta pruning cuts the search tree without changing the move it picks.
- Plain C, no dependencies, so I own the memory layout and the control flow.
engineering notes
CChess is a small chess engine in plain C. The idea was to keep the board state, the search, and the evaluation visible in the code, with nothing hiding what the engine is doing.
How it works
- Board state lives in bitboards, so updating a position and generating moves are bitwise operations instead of walking objects.
- Search is minimax with alpha-beta pruning. The pruning cuts the tree hard but still picks the same move.
- Evaluation scores positions with light heuristics (material, position, mobility), kept simple so it’s easy to tune.
Why plain C
The engine owns its memory and control flow. Bugs are reproducible because the behavior is deterministic, and with no dependencies the performance comes down to the code itself.