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

Rook castling positions appear in removed list multiple times #32

Open
olufjen opened this issue Aug 9, 2021 · 2 comments
Open

Rook castling positions appear in removed list multiple times #32

olufjen opened this issue Aug 9, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@olufjen
Copy link
Owner

olufjen commented Aug 9, 2021

For White rook 1:
piece: Piece position a1 X, Y (0, 0) wR a1 ROOK ActiveName R
Available positions
Position: h1 W X, Y (7, 0)
Position: g1 B X, Y (6, 0) Occupied by: WhiteKing
Position: f1 W X, Y (5, 0) Occupied by: WhiteRook2
Position: e1 B X, Y (4, 0)
Position: d1 W X, Y (3, 0) Occupied by: WhiteQueen
Position: c1 B X, Y (2, 0) Occupied by: WhiteBishop1
Position: b1 W X, Y (1, 0)
Position: a2 W X, Y (0, 1) Occupied by: WhitePawn1
Position: a3 B X, Y (0, 2)
Position: a4 W X, Y (0, 3)
Position: a5 B X, Y (0, 4)
Position: a6 W X, Y (0, 5)
Position: a7 B X, Y (0, 6) Occupied by: BlackPawn1
Position: a8 W X, Y (0, 7) Occupied by: BlackRook1
Removed positions
Position: g1 B X, Y (6, 0) Occupied by: WhiteKing
Position: f1 W X, Y (5, 0) Occupied by: WhiteRook2
Position: f1 W X, Y (5, 0) Occupied by: WhiteRook2
Position: f1 W X, Y (5, 0) Occupied by: WhiteRook2
Position: f1 W X, Y (5, 0) Occupied by: WhiteRook2
Position: d1 W X, Y (3, 0) Occupied by: WhiteQueen
Position: d1 W X, Y (3, 0) Occupied by: WhiteQueen
Position: c1 B X, Y (2, 0) Occupied by: WhiteBishop1
Position: f1 W X, Y (5, 0) Occupied by: WhiteRook2
Position: d1 W X, Y (3, 0) Occupied by: WhiteQueen
Position: f1 W X, Y (5, 0) Occupied by: WhiteRook2
Position: d1 W X, Y (3, 0) Occupied by: WhiteQueen
Position: f1 W X, Y (5, 0) Occupied by: WhiteRook2
Position: d1 W X, Y (3, 0) Occupied by: WhiteQueen
Position: a2 W X, Y (0, 1) Occupied by: WhitePawn1
Position: f1 W X, Y (5, 0) Occupied by: WhiteRook2
Position: d1 W X, Y (3, 0) Occupied by: WhiteQueen
Position: f1 W X, Y (5, 0) Occupied by: WhiteRook2
Position: d1 W X, Y (3, 0) Occupied by: WhiteQueen
Position: f1 W X, Y (5, 0) Occupied by: WhiteRook2
Position: d1 W X, Y (3, 0) Occupied by: WhiteQueen
Position: f1 W X, Y (5, 0) Occupied by: WhiteRook2
Position: d1 W X, Y (3, 0) Occupied by: WhiteQueen
Position: f1 W X, Y (5, 0) Occupied by: WhiteRook2
Position: d1 W X, Y (3, 0) Occupied by: WhiteQueen
Position: f1 W X, Y (5, 0) Occupied by: WhiteRook2
Position: d1 W X, Y (3, 0) Occupied by: WhiteQueen
Position: e1 B X, Y (4, 0)
...

@olufjen olufjen added the bug Something isn't working label Aug 9, 2021
@olufjen
Copy link
Owner Author

olufjen commented Aug 19, 2021

After castling, the King's position is still e1, according to the rook's position list
Both King and Rook remain in their original positions after castling, according to all other friendly pieces.
This is so because calculations for possible moves and available positions are done before the next move by the player.

@olufjen
Copy link
Owner Author

olufjen commented Sep 25, 2021

Solved bug in the checkCastling method of the chessAction object

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant