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

Fix castle #30

Open
oggy22 opened this issue Nov 11, 2024 · 0 comments
Open

Fix castle #30

oggy22 opened this issue Nov 11, 2024 · 0 comments

Comments

@oggy22
Copy link
Owner

oggy22 commented Nov 11, 2024

Currently, castle moves are available even when the either or both pieces moved previously. This shouldn't be allowed.

Suggested implementation:
Keep 4 flags:

  • WhiteSmallCastleAvailable
  • WhiteBigCastleAvailable
  • BlackSmallCastleAvailable
  • BlackBigCastleAvailable

Initially all 4 flags are on, but turned off in the following cases:

  • when corresponding pieces move
  • when corresponding pieces are taken

Object move also needs these 4 flags to update the chess position with.

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