stellar

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

bitboard.cpp (588B)


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