Refactor BitBoard
This commit is contained in:
20
Board.cpp
20
Board.cpp
@@ -196,25 +196,7 @@ bool Board::isMoveCastling(const BitBoard &from, const BitBoard &to, const Piece
|
||||
return (from & indexToBitBoard(E1));
|
||||
}
|
||||
|
||||
return (from & indexToBitBoard(E8));
|
||||
}
|
||||
void Board::printBitBoard(const Board::BitBoard &bb) {
|
||||
// For debugging only, performance isn't important
|
||||
for (int i = 7; i >= 0; i--) {
|
||||
int rank = i * 8;
|
||||
for (int j = 0; j < 8; j++) {
|
||||
// Get the piece for this index. Assume it exists.
|
||||
// Print piece, otherwise '.';
|
||||
if (bb & (1ULL << (rank + j))) {
|
||||
std::cout << 1;
|
||||
} else {
|
||||
std::cout << '.';
|
||||
}
|
||||
|
||||
std::cout << ' ';
|
||||
}
|
||||
std::cout << '\n';
|
||||
}
|
||||
return from & indexToBitBoard(E8);
|
||||
}
|
||||
|
||||
std::ostream &operator<<(std::ostream &os, const Board &board) {
|
||||
|
Reference in New Issue
Block a user