How pauljoohyunkim/simple-chess-engine works
Simple Chess Engine is a C chess engine exposed as both an interactive playable program and a UCI engine. The main workflow accepts a position and search request, maintains chess state, searches candidate moves, evaluates positions, and returns a best move. Its documented capabilities include bitboards, magic-bitboard move generation, alpha-beta with quiescence and iterative deepening, interchangeable SEF/HCEF evaluation, and UCI helper-thread search. Relationships involving unsampled search and playable-CLI code are omitted or marked unverified.
Main entry points: engine.c Search And Tables · sce_play.c Playable CLI · uci.c UCI Protocol · chess.c Board And Moves
Components 12
User Interfaces
- Playable CLI
src/bin/sce_play.c - UCI Engine App
src/bin/sce_uci_engine.c - UCI Protocol
src/uci.c
Chess State
- FEN Positions
src/fen.c - Board And Moves
src/chess.c - Magic Bitboards
src/magic.c
Search Engine
- Search And Tables
src/engine.c
Position Evaluation
- Simplified Eval
src/eval/sef.c - Handcrafted Eval
src/eval/hcef.c - Piece Tables
src/eval/pst.c
Other components
- Player
- UCI Host
Connections 15
- Player → Playable CLI: plays through
- UCI Host → UCI Engine App: starts
- UCI Engine App → UCI Protocol: dispatches commands
src/bin/sce_uci_engine.c - UCI Engine App → Search And Tables: initializes search
src/bin/sce_uci_engine.c - UCI Protocol → FEN Positions: loads positions
src/uci.c - UCI Protocol → Board And Moves: applies moves
src/uci.c - UCI Protocol → Search And Tables: requests search
- Search And Tables → Board And Moves: generates moves
src/engine.c - Search And Tables → Simplified Eval: uses eval callback
- Search And Tables → Handcrafted Eval: uses eval callback
- Handcrafted Eval → Piece Tables: uses piece tables
src/eval/hcef.c - Board And Moves → Magic Bitboards: uses slider tables
src/chess.c - Playable CLI → Board And Moves: plays moves
- Playable CLI → Search And Tables: requests best move
- Playable CLI → Handcrafted Eval: selects evaluation