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

Chess castling #18

Open
olufjen opened this issue Jan 11, 2021 · 4 comments
Open

Chess castling #18

olufjen opened this issue Jan 11, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@olufjen
Copy link
Owner

olufjen commented Jan 11, 2021

We need a method to perform chess castling
When all position to the left or right of the King then the king and the rook can exchange places.
A suggested procedure:
The moved piece is checked for castling.
If that is the case then the method returns which castle is involved

31.03.21:
For further work see issue Deferred action
12.05.21:
Castling works for the white players.

@olufjen olufjen added the enhancement New feature or request label Jan 11, 2021
@olufjen olufjen changed the title Chess rokade Chess castling Mar 24, 2021
@olufjen
Copy link
Owner Author

olufjen commented Mar 25, 2021

My first castling:
castling.PNG

The available positions are not changed:
Piece position f8 X, Y (5, 7) bR f8 ROOK ActiveName R
Available positions
Position: h1 W X, Y (7, 0)
Position: h2 B X, Y (7, 1) Occupied by: WhitePawn8
Position: h3 W X, Y (7, 2)
Position: h4 B X, Y (7, 3)
Position: h5 W X, Y (7, 4)
Position: h6 B X, Y (7, 5)
Position: h7 W X, Y (7, 6) Occupied by: BlackPawn8
Position: g8 W X, Y (6, 7) Occupied by: BlackKing
Position: f8 B X, Y (5, 7) Occupied by: BlackRook2
Position: e8 W X, Y (4, 7)
Position: d8 B X, Y (3, 7) Occupied by: BlackQueen
Position: c8 W X, Y (2, 7) Occupied by: BlackBishop1
Position: b8 B X, Y (1, 7) Occupied by: BlackKnight1
Position: a8 W X, Y (0, 7) Occupied by: BlackRook1
Removed positions
Position: h7 W X, Y (7, 6) Occupied by: BlackPawn8
Position: g8 W X, Y (6, 7) Occupied by: BlackKing
Position: d8 B X, Y (3, 7) Occupied by: BlackQueen
Position: c8 W X, Y (2, 7) Occupied by: BlackBishop1
Position: b8 B X, Y (1, 7) Occupied by: BlackKnight1
Position: a8 W X, Y (0, 7) Occupied by: BlackRook1

@olufjen
Copy link
Owner Author

olufjen commented Mar 25, 2021

The current castling move:
The white player makes two moves !!!
and the black Rook occupies wrong position

castling2.PNG

Piece name BlackRook2
rnbq1rk1/ppp11ppp/111bpn11/1N1P1111/111P1111/11111N11/PP11PPPP/R1BQKB1R
Piece position f8 X, Y (5, 7) bR f8 ROOK ActiveName R
Available positions
Position: g1 B X, Y (6, 0)
Position: g2 W X, Y (6, 1) Occupied by: WhitePawn7
Position: g3 B X, Y (6, 2)
Position: g4 W X, Y (6, 3)
Position: g5 B X, Y (6, 4)
Position: g6 W X, Y (6, 5)
Position: h8 B X, Y (7, 7)
Position: g7 B X, Y (6, 6) Occupied by: BlackPawn7
Position: f8 B X, Y (5, 7) Occupied by: BlackRook2
Position: e8 W X, Y (4, 7)
Position: d8 B X, Y (3, 7) Occupied by: BlackQueen
Position: c8 W X, Y (2, 7) Occupied by: BlackBishop1
Position: b8 B X, Y (1, 7) Occupied by: BlackKnight1
Position: a8 W X, Y (0, 7) Occupied by: BlackRook1
Removed positions
Position: g7 B X, Y (6, 6) Occupied by: BlackPawn7
Position: d8 B X, Y (3, 7) Occupied by: BlackQueen
Position: c8 W X, Y (2, 7) Occupied by: BlackBishop1
Position: b8 B X, Y (1, 7) Occupied by: BlackKnight1
Position: a8 W X, Y (0, 7) Occupied by: BlackRook1

Does not calculate correct removed positions. (see above list)

@olufjen
Copy link
Owner Author

olufjen commented Mar 26, 2021

Queen moved from b3 to h3:

castling260321.PNG

@olufjen
Copy link
Owner Author

olufjen commented Mar 31, 2021

For further work see issue Deferred action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant