mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-20 08:18:55 +00:00
LibChess: Forbid King moving into check by a pawn on the home rank
A player can no longer move the King piece into any position on their home rank if the move would place the King in check. A player can also no longer ignore a check position when in check by a pawn on their home rank. The player must now resolve the check during their move.
This commit is contained in:
parent
6365b44773
commit
d4c34d50c9
Notes:
sideshowbarker
2024-07-19 01:38:46 +09:00
Author: https://github.com/bcoles
Commit: d4c34d50c9
Pull-request: https://github.com/SerenityOS/serenity/pull/3874
Issue: https://github.com/SerenityOS/serenity/issues/3525
Issue: https://github.com/SerenityOS/serenity/issues/3526
Reviewed-by: https://github.com/petelliott ✅
2 changed files with 60 additions and 25 deletions
|
@ -159,6 +159,7 @@ public:
|
|||
|
||||
private:
|
||||
bool is_legal_no_check(const Move&, Colour colour) const;
|
||||
bool is_legal_promotion(const Move&, Colour colour) const;
|
||||
bool apply_illegal_move(const Move&, Colour colour);
|
||||
|
||||
Piece m_board[8][8];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue