Backgammon
A complete C++ implementation of classic backgammon. I rewrote an older procedural course project into a cleaner object-oriented architecture with separated board logic, rendering, move validation, and player strategies.
Architecture
The player system is built around an abstract Player class. Concrete implementations
include a human-controlled player, a random player, and a simple AI player that prioritizes hits and
piece safety.
- Real_player: validates user input and handles manual moves.
- Rand_player: selects a legal move randomly.
- AI_player: applies a small strategy layer over legal move generation.
Rules Covered
- Standard checker movement based on dice rolls.
- Hitting opponent pieces and moving them to the bar.
- Mandatory re-entry from the bar before other moves.
- Doubles as four moves instead of two.
- Bearing off and full move legality validation.