How ondrejpupik/chess works
This is a single-file SFML chess game. The player holds and moves pieces in the window; the game loop handles play and invokes chess-rule checks, while piece movement and promotion update the board. The excerpt shows legality, king-safety and checkmate logic, plus promotion selection. Components share chess.cpp because the repository has no separate runtime modules; unsampled details are omitted rather than inferred.
Main entry points: chess.cpp Game Loop
Components 6
Game Interaction
- Game Loop
chess.cpp - Promotion Choice
chess.cpp
Chess Rules
- Move And Check Rules
chess.cpp
Game State
- Board And Pieces
chess.cpp
Other components
- Player
- SFML Window
Connections 5
- Player → Game Loop: moves pieces
README.md - Game Loop → Move And Check Rules: checks moves
chess.cpp - Game Loop → Promotion Choice: opens choice
chess.cpp - Game Loop → SFML Window: draws window
chess.cpp - Move And Check Rules → Board And Pieces: reads position
chess.cpp