A console-based Checkers game built in Python to explore how to design a clean game engine: board state management, move validation, captures, king promotion, and a simple computer opponent. The project is structured with a clear separation between domain logic, services, and UI, and includes custom exceptions and unit tests.
- 8x8 board initialization with standard Checkers setup
- Move validation (diagonal movement, bounds checking, empty destination)
- Capture logic (jump moves remove opponent piece)
- King promotion for both players
- Console UI with colored pieces (Human vs Computer)
- Simple AI opponent that prioritizes capturing moves (jumps) before normal moves
- Unit tests for core board behavior
- Domain (
game/domain): board representation + rules (valid moves, captures, game-over logic) - Service (
game/service): orchestrates turns and applies rules for Human/Computer players - UI (
game/ui): console interaction layer (input/output) - Exceptions (
game/exceptions): domain-specific errors for invalid moves and ownership
This separation keeps game rules testable and independent from the UI.
- Python 3
texttablefor rendering the boardcoloramafor terminal coloringunittestfor automated testing