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

Optimize moves generation for Bishop #27

Open
zxul767 opened this issue Mar 22, 2022 · 1 comment
Open

Optimize moves generation for Bishop #27

zxul767 opened this issue Mar 22, 2022 · 1 comment

Comments

@zxul767
Copy link
Owner

zxul767 commented Mar 22, 2022

I recently discovered and read the source code for python-chess and found that they have quite an efficient (and clever) implementation for legal moves of a bishop (and other sliding pieces, like rooks and queens).

See this link for details (in particular, the implementation of the _attack_table function)

@zxul767 zxul767 added the p1 label Mar 22, 2022
@zxul767
Copy link
Owner Author

zxul767 commented Mar 22, 2022

It is not clear how much this particular optimization would accelerate the search overall (we'd need to profile this a bit since maybe a major bottleneck is currently elsewhere--e.g., in position evaluation), but given that there's a reference implementation which is not too convoluted, it may be worth trying (though it would be important to measure performance before and after the change)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant