stellar

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

bitboard.cpp (565B)


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