How 2040pi/chess works
This repository is a chess engine with terminal, graphical, UCI-protocol, and self-play entry points. In the main workflow, a player or chess GUI supplies a position, an interface delegates computer moves to the engine, and the engine searches legal moves using evaluation and move ordering. Evaluation combines piece-square and material values with attacked-square scoring. The terminal and graphical interfaces, and the self-play runner, also write PGN output. The README gives no further capability detail; relationships shown here are supported by the sampled files and README evidence.
Main entry points: engine.py Move selection · cli.py Terminal game · gui.py Graphical game · minimax.py Minimax search
Components 14
Game interfaces
- Terminal game
cli.py - Graphical game
gui.py - UCI protocol
uci.py - Self-play runner
main.py
Move search
- Move selection
engine.py - Minimax search
minimax.py - Move ordering
preorderMoves.py
Position evaluation
- Position scoring
eval.py - Attacked-square scoring
attackedSquares.py - Chess value tables
tables.py
Game output
- PGN game file
Other components
- Terminal player
- Chess GUI
- UCI client
Connections 17
- Terminal player → Terminal game: enters moves
cli.py - Terminal game → Move selection: requests moves
cli.py - Chess GUI → Graphical game: enters moves
gui.py - Graphical game → Move selection: requests moves
gui.py - UCI client → UCI protocol: sends commands
uci.py - UCI protocol → Move selection: starts search
uci.py - Self-play runner → Move selection: requests moves
main.py - Move selection → Minimax search: selects move
engine.py - Minimax search → Move ordering: orders moves
minimax.py - Minimax search → Position scoring: scores leaves
minimax.py - Position scoring → Chess value tables: reads values
eval.py - Position scoring → Attacked-square scoring: scores attacks
eval.py - Attacked-square scoring → Chess value tables: reads weights
attackedSquares.py - Move ordering → Chess value tables: reads values
preorderMoves.py - Terminal game → PGN game file: writes PGN
cli.py - Graphical game → PGN game file: writes PGN
gui.py - Self-play runner → PGN game file: writes PGN
main.py