And I don’t tell anything about Catalunya because it’s not related in any way.
After this little misunderstanding, I get back to chess.
Sure I can!Gerd Isenberg wrote: * Faster calculation of piece attacks. No need any further of rotated bitboards.
Hi Daniel,
can you elaborate a bit on how you generate sliding attack bitboards?
Do you use incremental updated attack tables, i.e. attacksFrom[64]?
Gerd
I translated , as I said, the code.
This is the basic idea:
Code: Select all
if (BitScanForward(&indexbit, PreCalcRook[square].BitboardRookGoesUpFromThisSquare & position->AllThePieces)) {
*AttacksOfPiece |= PreCalcRook [square]. BitboardRookGoesUpFromThisSquare & RowsAt1FromRow0ToRow [ROW(indexbit)];
} else {
* AttacksOfPiece |= PreCalcRook [square]. BitboardRookGoesUpFromThisSquare;
}
00000000
00000000
00000000
11111111
11111111
11111111
11111111
11111111
With this I obtain the bitboard of attacks.
This is done in every 4 directions.
The same it’s used for Bishops/Queens.
I use a little optimization more. For the horizontal attacks of the rook/queen, I can use:
Code: Select all
Bytes_AttacksOfPiece [ROW(square)]=AttacksRow[COL(square)][Bytes_AllThePieces[ROW(square)]];
So, Bytes_AttacksOfPiece and Bytes_AllThePieces, are array of bytes that share the same memory of the bitboards AttacksOfPiece and AllThePieces. Obviously this cannot be done for vertical or diagonal movements.
All this is a little improvement for what I had before. I know this is not very nice and I suppose it’s slower than magic bitboards, but the idea is to put magic bitboards when I understand them, and I did not used time for this for the moment.