- const int MagicBoosters[][8] = { { 55, 11, 17, 2, 39, 3, 31, 44 },
- { 26, 21, 21, 32, 31, 9, 5, 11 } };
+ // init_magic_bitboards() computes all rook and bishop magics at startup.
+ // Magic bitboards are used to look up attacks of sliding pieces. As reference
+ // see chessprogramming.wikispaces.com/Magic+Bitboards. In particular, here we
+ // use the so called "fancy" approach.
+
+ void init_magic_bitboards(Bitboard* attacks[], Bitboard magics[],
+ Bitboard masks[], int shifts[], Square deltas[]) {
+
+ const int MagicBoosters[][8] = { { 3191, 2184, 1310, 3618, 2091, 1308, 2452, 3996 },
+ { 1059, 3608, 605, 3234, 3326, 38, 2029, 3043 } };