Problem
Design a chess game that enforces piece movement rules and detects checkmate or stalemate for two local players
- Keep each piece’s movement logic isolated in its own class instead of branching on type
- Validate that a candidate move does not leave the player’s own king in check
- Distinguish checkmate from stalemate using a single no-legal-move test
Key Test Points
- Polymorphic canMove on each Piece subtype
- Tentative apply and undo
- Reusing canMove for attack detection
Spot an issue or have a suggestion?