rbaltrusch / chess_ng

Full chess engine including chess AI
MIT License
2 stars 2 forks source link

Add king check and checkmate #5

Closed rbaltrusch closed 2 years ago

rbaltrusch commented 2 years ago

Currently, the chess engine allows a side to keep playing any move, even if its king is in check. This should not be allowed. Instead, the side should only allow moves which move its king out of check. If there are no such moves, the game ends in checkmate.

rbaltrusch commented 2 years ago

Implemented in commit e1014fe. If the king is in check and no moves are possible that move it out of check, the game ends in checkmate.