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, Harvey Williamson, bob
Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
-
Aleks Peshkov
- Posts: 845
- Joined: Sun Nov 19, 2006 8: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.
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
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......