How pktlmezun/chess-engine works
This is a C++17 chess engine exposed through UCI. A GUI sends position and search commands; the engine builds or updates a board, searches for a move, and returns UCI output. The core includes move generation, bitboard attacks, position evaluation, and a transposition table. The README documents the search and evaluation features; source-level links are limited to the excerpts and SOURCE INDEX references provided.
Main entry points: board.cpp Board state · uci.cpp UCI handler · search.cpp Iterative search · movegen.cpp Move generation
Components 12
UCI interface
- Engine entry
src/main.cpp - UCI handler
src/uci.cpp - Position setup
src/uci.cpp
Search
- Iterative search
src/search.cpp - Transposition table
src/search.cpp
Chess core
- Move generation
src/movegen.cpp - Board state
src/board.cpp - Attack tables
src/bitboard.cpp - Move encoding
src/move.h - Chess types
src/types.h
Evaluation
- Position evaluation
src/eval.cpp
Other components
- UCI GUI
Connections 19
- UCI GUI → UCI handler: sends commands
README.md - Engine entry → UCI handler: starts loop
src/main.cpp - UCI handler → Position setup: handles position
src/uci.cpp - Position setup → Board state: sets and updates
src/uci.cpp - Position setup → Move generation: parses moves
src/uci.cpp - UCI handler → Attack tables: initializes tables
src/uci.cpp - UCI handler → Iterative search: starts or stops
src/uci.cpp - Iterative search → Move generation: generates moves
src/search.cpp - Iterative search → Position evaluation: evaluates positions
src/search.cpp - Iterative search → Board state: makes and unmakes
src/search.cpp - Iterative search → Transposition table: probes and stores
README.md - Move generation → Board state: reads positions
- Move generation → Attack tables: uses attack tables
src/movegen.cpp - Board state → Attack tables: queries attacks
README.md - Board state → Move encoding: applies moves
- Board state → Chess types: uses chess types
- Move encoding → Chess types: uses chess types
src/move.h - Position evaluation → Board state: evaluates position
- UCI handler → UCI GUI: returns UCI output
README.md