working move gen

This commit is contained in:
2024-03-19 22:21:18 +01:00
parent f0fe9454f8
commit 3b9fc1f872
11 changed files with 95 additions and 66 deletions

22
src/common/print.c Normal file
View File

@ -0,0 +1,22 @@
#include "chess/types.h"
#include <stdio.h>
#include <stdint.h>
#include <chess/bitboard.h>
void printerll(FILE *file, long long num) {
fprintf(file, "%lld", num);
}
void printerull(FILE *file, unsigned long long num) {
fprintf(file, "%lluu", num);
}
// for debugging
void printPieceMask(uint_least64_t mask) {
for(uint_least8_t i = 0; i < BOARD_SIZE; ++i, mask >>= BOARD_SIZE) {
for(uint_least8_t j = 0; j < BOARD_SIZE; ++j) {
printf("%d ", bitsetGet(mask, j));
}
printf("\n");
}
}