Changes

Jump to: navigation, search

First Rank Attacks

349 bytes added, 21:55, 16 June 2021
no edit summary
<span id="TheOuterSquares"></span>
==The Outer Squares==
If we think about to the occupancy lookup, we may recognize that the outer squares don't matter. There are no more squares behind. The outer squares are either attacked or not - independent from their occupancy state. We can use the '''six inner bits''' only as lookup-index with two additional cheap instructions.
<pre>
BYTE arrFirstRankAttacks64x8[64][8]; // 512 Bytes = 1/2KByte
unsigned int file = sq & 7;
unsigned int rkx8 = sq & 56; // rank * 8
occ unsigned int rankOccX2 = (occ >> rkx8) & 2*63;// 2 times the inner six bit rank occupancy used as index U64 attacks = arrFirstRankAttacks64x8[4*occ rankOccX2 + file];// 8 * rank occupancy + file
return attacks << rkx8;
}
=See also=
* [[Occupancy of any Line]]
* [[Rotated BitboardsHyperbola Quintessence]]
* [[Kindergarten Bitboards]]
* [[Magic Bitboards]]
* [[Rotated Bitboards]]
 
=Forum Posts=
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=71312 Understanding first rank attack state generation] by [[Kalyankumar Ramaseshan]], [[CCC]], July 18, 2019 » [[Hyperbola Quintessence]]
'''[[Sliding Piece Attacks|Up one Level]]'''

Navigation menu