diff options
Diffstat (limited to 'src/bitboard.c')
-rw-r--r-- | src/bitboard.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/bitboard.c b/src/bitboard.c index cffe40f..c0abbf8 100644 --- a/src/bitboard.c +++ b/src/bitboard.c @@ -3,7 +3,7 @@ /* Print bitboard on screen in the same way squares appear in memory * (i.e the board is actually flipped along X) */ -void print_bitboard(Bitboard bb) { +void printBitboard(Bitboard bb) { for (U64 index = 0; index < 64; index++) { printf("%lu", (bb >> index) & 1); if ((index + 1) % 8 == 0) printf("\n"); @@ -12,9 +12,9 @@ void print_bitboard(Bitboard bb) { } /* Return bitboard cardinality, aka number of elements in the set */ -inline int pop_count(Bitboard bb){ +inline int popCount(Bitboard bb){ if (bb == 0) return 0; - return pop_count(bb >> 1) + (bb & 1); + return popCount(bb >> 1) + (bb & 1); } /* Return Bitboard with only Least Single Bit */ @@ -26,7 +26,7 @@ inline Bitboard ls1b(Bitboard bb) { * Only works for SINGLE Bitboards * Useful for calculating bit-index of LS1B */ inline int bitscan(Bitboard bb) { - return pop_count(ls1b(bb) - 1); + return popCount(ls1b(bb) - 1); } /* Bitscan forward with LS1B reset */ |