dangi12012 wrote: ↑Mon Jan 02, 2023 10:29 pm
Interesting.
Whats inside these arrays: rookViticleBlockers, rookHorizontalBlockers, vSuperset, hSuperset?
Is this already a working prototype or in the idea stage?
Does it work for bishops too?
I have not done the initialization yet. I was going to that today but for some reason I had to sleep all day. Seemed I had no choice.
Anyway, I created it while I wrote it. It was easy because because it is just the perfect fusion between Gerd's Kindergarten and my SISSY bitboards.
They are defined better in my krazy professor thread. I'll go get that code.
Code: Select all
u64 RookAttacks(sq, occ) {
u64 vBlockers = (occ & vFileMask[sq]);
u64 hBlockers = (occ & hRankMask[sq]);
u64 vIndex = (vBlockers >> (sq & 7) * MAIN_DIAGONAL) >> 57;
u64 hIndex = hBlockers >> ((sq >> 3) + 1;
return vSuperSet[sq][vIndex] & hSuperSet[sq][hIndex];
As Gerd said, "Wasn't that simple? That is why it is called kindergarten bitboards" as it uses a simple multiplication!
And the name SISSY is because of two indexes (Split Index) Yielding two Super Sets!
Code: Select all
u64 BishopAttacks(sq, occ) {
u64 dBlockers = occ & diagonalMask[sq];
u64 aBlockers = occ & antidiagMask[sq];
u64 dIndex = (dBlockers * 0x0202020202020202) >> 58;
u64 aIndex = (aBlockers * 0x0202020202020202) >> 58;
return dSuperSet[sq][dIndex] & aSuperSet[sq][aIndex];
}
And yes the Bishop is also designed.
Oops, seems I screwed up the code. Let me see if I can unscrew it then I have to go back to bed.
Okay it looks good now. vSuperSet and hSuperSet are just supersets like in SISSY meaning the superset derived from only the vertical blockers or the horizontal blockers. Then they are & together to form the real set.
Does that make sense?