stellar

UCI Chess engine written in C++20
git clone git://git.dimitrijedobrota.com/stellar.git
Log | Files | Refs | README | LICENSE

bitboard.cpp (588B)


0 #include "bitboard.hpp"
1 #include "bit.hpp"
2 #include "piece.hpp"
4 #include <iostream>
6 namespace bitboard {
8 void print(U64 bitboard) {
9 for (int rank = 0; rank < 8; rank++) {
10 for (int file = 0; file < 8; file++) {
11 uint8_t square = (7 - rank) * 8 + file;
12 if (!file) printf(" %d ", 8 - rank);
13 std::cout << bit::get(bitboard, square) << " ";
14 }
15 std::cout << "\n";
16 }
18 std::cout << "\n A B C D E F G H\n\n";
19 std::cout << " Bitboard: " << std::hex << bitboard << std::dec << std::endl;
20 }
22 } // namespace bitboard