17 #define DLL_API __declspec(dllexport) 31 unsigned long long transpose(
unsigned long long);
39 #define foreach_bit(i, b) for (i = first_bit(b); b; i = next_bit(&b)) 41 extern const unsigned long long X_TO_BIT[];
43 #define x_to_bit(x) X_TO_BIT[x] void bitboard_write(const unsigned long long, FILE *)
Print an unsigned long long as a board.
Definition: bit.c:435
unsigned short bswap_short(unsigned short)
Swap bytes of a short (little <-> big endian).
Definition: bit.c:391
unsigned long long transpose(unsigned long long)
Transpose the unsigned long long (symetry % A1-H8 diagonal).
Definition: bit.c:345
int bit_weighted_count(const unsigned long long)
count the number of discs, counting the corners twice.
Definition: bit.c:143
DLL_API int first_bit(unsigned long long)
Search the first bit set.
Definition: bit.c:173
const unsigned long long X_TO_BIT[]
Definition: bit.c:18
int get_rand_bit(unsigned long long, struct Random *)
Get a random set bit index.
Definition: bit.c:415
int next_bit(unsigned long long *)
Search the next bit set.
Definition: bit.c:248
unsigned int bswap_int(unsigned int)
Mirror the unsigned int (little <-> big endian).
Definition: bit.c:401
unsigned long long horizontal_mirror(unsigned long long)
Mirror the unsigned long long (exchange the line 1 - 8, 2 - 7, 3 - 6 & 4 - 5).
Definition: bit.c:377
unsigned long long vertical_mirror(unsigned long long)
Mirror the unsigned long long (exchange the lines A - H, B - G, C - F & D - E.).
Definition: bit.c:364
#define DLL_API
Definition: bit.h:19
DLL_API int bit_count(unsigned long long)
Count the number of bits set to one in an unsigned long long.
Definition: bit.c:72
DLL_API int last_bit(unsigned long long)
Search the last bit set (same as log2()).
Definition: bit.c:264