Design a Chess Game
Pieces know geometry, the game decides legality: make the move, look at the king, take it back. Castling rights and the en passant square as history, an undo record for every move, checkmate versus stalemate from one question, a lock even for reads, and perft counts that prove it.
01 · The pinned bishop
LLD-10 · Design a Chess Game
The bishop can see d3. It still can't go there.
Six subclasses, one method
Everyone starts chess the same way.
0:00 / 13:56