Skip to content

Commit

Permalink
fix queen side castling issue
Browse files Browse the repository at this point in the history
Unable to provide queen side castling for `r1bq1rk1/pp2npbp/2np2p1/2p5/4P2P/2NPB1P1/PPP1QPB1/R3K2R w KQq - 0 1` FEN.
  • Loading branch information
govind-maheshwari2 authored Dec 3, 2024
1 parent 9f9fe54 commit dad4524
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/src/game/game.dart
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ class Game {
continue;
} // king starting on target

if (j != numMidSqs && board[midSq].isNotEmpty) {
if (j != numMidSqs && from != midSq && board[midSq].isNotEmpty) {
// squares between to and from must be empty
valid = false;
break;
Expand Down

0 comments on commit dad4524

Please sign in to comment.