I stumbled across magic move bitboards and the included the code by Pradyumma Kannan in my old program, as a quick hack. Since it did not work I guess the square mapping is important and mine
(for (sq = 0; sq < 64; sq++) bbSquare[sq] = bit << (63 - sq);)
incompatible. I assumed that the mapping would be equivalent to
(for (sq = 0; sq < 64; sq++) bbSquare[sq] = bit << (sq);),
but a simple remapping of my occupied bitboard before the call to the supplied macros does not yield the correct result. Did I miss something blindingly obvious?
Frank
magic move - bitboard orientation
Moderators: hgm, Rebel, chrisw
-
- Posts: 892
- Joined: Sun Nov 19, 2006 9:16 pm
- Location: Russia
Re: magic move - bitboard orientation
Bishops and rooks are symmetrical in all directions, but your current position occupation bitboard parameter is not.
-
- Posts: 287
- Joined: Sat Mar 11, 2006 3:19 am
- Location: Atlanta, GA
Re: magic move - bitboard orientation
Try (R/B)magic(occ,sq^63) and see if that works. If not I'm not really sure. Could you post some sample calls for us to see?frankp wrote:I stumbled across magic move bitboards and the included the code by Pradyumma Kannan in my old program, as a quick hack. Since it did not work I guess the square mapping is important and mine
(for (sq = 0; sq < 64; sq++) bbSquare[sq] = bit << (63 - sq);)
incompatible. I assumed that the mapping would be equivalent to
(for (sq = 0; sq < 64; sq++) bbSquare[sq] = bit << (sq);),
but a simple remapping of my occupied bitboard before the call to the supplied macros does not yield the correct result. Did I miss something blindingly obvious?
Frank
-
- Posts: 228
- Joined: Sun Mar 12, 2006 3:11 pm
Re: magic move - bitboard orientation
Thanks, (sq ^ 63) did the trick. Magic.
In the interim I have started rewriting and 'improving' my ancient code......
In the interim I have started rewriting and 'improving' my ancient code......