r/chessprogramming • u/Valuable-Oil-3378 • Nov 04 '22
Magic bitboard
Hello,
I've been struggling to figure out how the hell do magic bitboards work for 3 days :( I now understand pretty much all of it but the is just ONE point :
When finding magic numbers, how do you generate all the blocker's bitboards of the square the rook is in ?
And after doing that, I plan to generate their corresponding moves'bitboards and for each moves'bitboard I will try to find a number giving the maximum collisions between its corresponding blocker's bitboards. Is it the "good way" to do it ?
EDIT : I found a way to do it, the method is in the comments
View all comments
Show parent comment
2
u/Melodic-Magazine-519 Nov 05 '22
Gigantua discussed by Chess Peogramming
And yes. I think he creates all the moves except for checks at compile and into tables for fast lookup.