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

castling rights on rook capture. closes nvzqz/Sage#8 #13

Merged
merged 3 commits into from
Dec 19, 2016

Conversation

captainsano
Copy link
Contributor

No description provided.

@nvzqz
Copy link
Owner

nvzqz commented Dec 19, 2016

This does not restore rook castling rights if the capture is undone.

Also, the if let _ = capture?.kind.isRook { part passes for any capture. Instead do:

if let capture = capture, capture.kind.isRook {
    ...
}

@captainsano
Copy link
Contributor Author

Made the change with if let ... _undoMove seems to already restore the castling rights. What do you mean by undoing the capture?

@nvzqz
Copy link
Owner

nvzqz commented Dec 19, 2016

Sorry, I should've specified. It's been a while since I looked through the code for the project. You're right. I forgot that castling rights were retained in history.

It also may look cleaner to use the isWhite and isBlack properties of Color.

One last thing, the tests on Xcode 7.3 fail to compile: https://travis-ci.org/nvzqz/Sage/jobs/185092484

@captainsano
Copy link
Contributor Author

Done, build passing now!

@nvzqz nvzqz merged commit aa275da into nvzqz:develop Dec 19, 2016
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

Successfully merging this pull request may close these issues.

2 participants