How dheirav/chessbot works
ChessBot is a local chess-playing and analysis application with graphical, terminal-coach, and UCI entry modes. In the main game workflow, a player enters moves through the GUI; game management validates and records them, requests an engine search when appropriate, and applies the returned move. The engine’s search uses chess rules, evaluation, ordering, and cached positions to choose a move. The README also documents PGN export, clocks, undo/redo, terminal detection, and UCI controls. Some subsystem links reflect README capabilities; unsampled implementations are not inferred beyond those documented roles.
Main entry points: game_manager.cpp Game coordinator · search.cpp Search · main.cpp Mode selection · gui_manager.cpp Window manager
Components 19
Application modes
- Mode selection
src/main.cpp - Coach mode
src/coach.cpp - UCI protocol
src/engine/uci.cpp
Game interaction
- Window manager
src/gui_manager.cpp - Board input
src/gui/input.cpp - Board and HUD
src/gui/renderer.cpp - Game coordinator
src/game_manager.cpp - PGN export
src/engine/pgn.cpp
Chess position
- Board state
src/engine/board.cpp - Move generation
src/engine/movegen.cpp - Legal move checks
src/engine/legal_move_validator.cpp - FEN positions
src/engine/fen.cpp
Engine search
- Engine adapter
src/engine/chessbot_engine.cpp - Search
src/engine/search.cpp - Position evaluation
src/engine/evaluation.cpp - Move ordering
src/engine/move_ordering.cpp - Transposition table
src/engine/transposition_table.cpp
Other components
- Player
- UCI client
Connections 24
- Player → Mode selection: starts app
- UCI client → Mode selection: selects UCI
- Mode selection → Window manager: starts GUI
- Mode selection → Coach mode: runs coach
- Mode selection → UCI protocol: runs protocol
- Player → Window manager: plays moves
- Window manager → Board input: routes events
- Window manager → Game coordinator: updates game
- Board input → Game coordinator: submits moves
- Game coordinator → Board and HUD: supplies game view
- Game coordinator → Board state: updates position
- Game coordinator → Legal move checks: checks legality
- Game coordinator → Engine adapter: requests search
- Game coordinator → PGN export: exports game
- UCI protocol → Engine adapter: controls engine
- Engine adapter → Search: searches position
- Search → Move generation: generates moves
- Search → Position evaluation: scores positions
- Search → Move ordering: orders moves
- Search → Transposition table: probes and stores
- Move generation → Board state: reads position
- Legal move checks → Board state: checks position
- FEN positions → Board state: loads position
- Coach mode → Game coordinator: advises game