More readable init of MS1BTable[]
Because now it uses lsb(), the BSFTable[] must be already initialized. No functional change.pull/358/head
parent
b71418defa
commit
1ff5ce8863
|
@ -151,13 +151,12 @@ const std::string Bitboards::pretty(Bitboard b) {
|
|||
|
||||
void Bitboards::init() {
|
||||
|
||||
for (int k = 0, i = 0; i < 8; ++i)
|
||||
while (k < (2 << i))
|
||||
MS1BTable[k++] = i;
|
||||
|
||||
for (Square s = SQ_A1; s <= SQ_H8; ++s)
|
||||
BSFTable[bsf_index(SquareBB[s] = 1ULL << s)] = s;
|
||||
|
||||
for (Bitboard b = 1; b < 256; ++b)
|
||||
MS1BTable[b] = more_than_one(b) ? MS1BTable[b - 1] : lsb(b);
|
||||
|
||||
FileBB[FILE_A] = FileABB;
|
||||
RankBB[RANK_1] = Rank1BB;
|
||||
|
||||
|
|
Loading…
Reference in New Issue