Open zxul767 opened 2 years ago
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)
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)