Move methods from Board to BitBoard

This commit is contained in:
2022-12-22 01:35:37 +01:00
parent a1d4dadaa2
commit 84afaa2ada
4 changed files with 143 additions and 109 deletions

View File

@@ -23,4 +23,11 @@ std::ostream &operator<<(std::ostream &os, const BitBoard &board) {
}
return os;
}
}
BitBoard BitBoard::getRank(int r) {
return (genShift(1ULL, (r + 1) * 8) - 1) & genShift(~1ULL, r * 8 - 1);
}
BitBoard BitBoard::genShift(BitBoard x, const int s) {
return (s < 0) ? (x >> -s) : (s > 63) ? x : (x << s);
}