Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to generate queen side castling move #85

Open
govind-maheshwari2 opened this issue Dec 3, 2024 · 0 comments
Open

unable to generate queen side castling move #85

govind-maheshwari2 opened this issue Dec 3, 2024 · 0 comments

Comments

@govind-maheshwari2
Copy link
Contributor

govind-maheshwari2 commented Dec 3, 2024

FEN : r1bq1rk1/pp2npbp/2np2p1/2p5/4P2P/2NPB1P1/PPP1QPB1/R3K2R w KQq - 0 1
Move generated for white king : {d2, f1, d1, g1}

Issue line:

if (j != numMidSqs && board[midSq].isNotEmpty) {

Following code seem to be fixing the issue

  if (j != numMidSqs && from != midSq && board[midSq].isNotEmpty) {
              // squares between to and from must be empty
              valid = false;
              break;
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant