/**
* CollapseFiles(bitboard) folds a bitboard vertically into an 8 bit word.
* By or-ing the files of a bitboard, a 8-bit folded bitboard is calculated.
* E.g. by folding a bitboard containing the position of all pawns open files
* can be determined:
*
* abcdefgh
*
* 8 00000000
* 7 10100110
* 6 00010001 abcdefgh
* 5 00000000 => CollapseFiles() => 11110111
* 4 00010000
* 3 00100000 Negating the result yields the open-property of
* 2 11000011 the 8 files => the e-file is open.
* 1 00000000
*
* Pawns
*/unsignedchar CollapseFiles(bitboard src){
src |= src >>32;
src |= src >>16;
src |= src >>8;return(unsignedchar)(src &0xff);}/**
* CollapseRanks() folds a bitboard horizontally into an 8 bit word.
* This is similar to CollapseFiles(bitboard).
*/unsignedchar CollapseRanks(bitboard src){
src |= src >>4;// No masking needed
src |= src >>2;// " "
src |= src >>1;// " "return(unsignedchar)(((src &0x0101010101010101)*0x0102040810204080)>>56);}
a Chess Engine Communication Protocol and UCI compliant open source chess engine under the GNU General Public License, written by Oliver Uwira in C. Able to play Chess960, Kurt participated at the 2nd Livingston Chess960 Computer World Championship 2006 in Mainz. The last recent Kurt 0.9.2.2 beta is available from Jim Ablett's site. It seems, the beta version still has some issues to run steadily [1].
Table of Contents
Bitboards
Sliding Piece Attacks
Kurt 0.9.2.x beta is a none rotated bitboard engine [3], and uses a three-dimensional pre-initialized array of 128 KByte to lookup sliding piece attacks, indexed by square (0..63), line occupancy index (0..63, considering the outer squares) and finally the four line directions (0..3) for ranks, files, diagonals and anti-diagonals. The six-bit line occupancy index is calculated from the masked line of empty squares, multiplied by a 64-bit De Bruijn sequence [4] for each square and direction, shifting the product right by 58 .BitScan
Kurt 0.9.2.x beta uses Matt Taylor's folded BitScan. Returning a byte [5].Collapsing Files and Ranks
Collapsed files and collapsed ranks, as posted by Urban Koistinen in 1997 [6], and Steffan Westcott in 2006 [7] are used in 0.9.2.x for initialization purposes:Search
Kurt's search is PVS with null move pruning and killer heuristic with two slots for mate killers and other killer moves each, kept in its parent's node structure. Further, SEE is used in move ordering and quiescence search pruning.See also
Forum Posts
External Links
References
What links here?
Up one Level