return self->pieceBB[PAWN] & self->pieceBB[color];
}
void CBoard_print(CBoard_T self) {
for (int rank = 0; rank < 8; rank++) {
for (int file = 0; file < 8; file++) {
int square = (7 - rank) * 8 + file;
Piece_T piece = NULL;
int color = -1;
if (bit_get(self->colorBB[WHITE], square))
color = WHITE;
else if (bit_get(self->colorBB[BLACK], square))
color = BLACK;
if (color != -1) {
for (int piece_index = 0; piece_index < 6; piece_index++) {
if (bit_get(self->pieceBB[piece_index], square)) {
piece = &Pieces[color][piece_index];
break;
}
}
}
if (!file)
printf(" %d ", 8 - rank);
printf("%s", (piece) ? Piece_unicode(piece) : ". ");
}
printf("\n");
}
printf(" A B C D E F G H\n");
printf(" Side: %s\n", (self->side == WHITE) ? "white" : "black");
printf("Enpassant: %s\n", square_to_coordinates[self->enpassant]);
printf(" Castling: %c%c%c%c\n", (self->castle & WK) ? '-' : ' ',
(self->castle & WQ) ? '-' : ' ', (self->castle & BK) ? '-' : ' ',
(self->castle & BQ) ? '-' : ' ');
printf("\n");
}
/* ... */
void bitboard_print(U64 bitboard) {