rbaltrusch / chess_ng

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

Disallow moves that put the allied king into check + Stalemate #6

Closed rbaltrusch closed 2 years ago

rbaltrusch commented 2 years ago

Currently, a side can make a move, even if this move results in its own king getting checked. This should not be possible.

Instead, possible moves should be filtered to only keep moves that do not result in the king getting checked. If there are no such moves, the game ends in stalemate.

rbaltrusch commented 2 years ago

Implemented in commit e1014fe. Moves that move the allied king into check now are no longer possible.