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

Wrap all access to LineBB and add assert. #2719

Closed

Conversation

protonspring
Copy link

This is a non-functional code style change which provides a safe access handler for LineBB. Also includes an assert in debug mode to verify square correctness. Please let me know if this needs to be tested.

@vondele vondele added the to be merged Will be merged shortly label Jun 8, 2020
@snicolet
Copy link
Member

snicolet commented Jun 8, 2020

This PR would be a good occasion to add examples for line_bb() and between_bb(), if only to make obvious the difference between the two functions, and also as a quick reference showing if the extrémal squares are included in between_bb() or not.

Something like:

For instance, line_bb(c4, f7) returns the bitboard corresponding to the whole diagonal a2-g8.

For instance, between_bb(c4, f7) returns the bitboard with the squares d5 and e6.

PS: i am away from computer, so double check the examples 🙂

@protonspring
Copy link
Author

Will do . . just a few minutes.

@vondele vondele closed this in b0eb5a1 Jun 9, 2020
@vondele
Copy link
Member

vondele commented Jun 9, 2020

Thanks!

MichaelB7 pushed a commit to MichaelB7/Stockfish that referenced this pull request Jun 13, 2020
This is a non-functional code style change which provides a safe access handler for LineBB.
Also includes an assert in debug mode to verify square correctness.

closes official-stockfish#2719

No functional change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
to be merged Will be merged shortly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants