start bitboard init (see commit details)

- bitboard.c: make attacks for knight/king
- square macros (BB, BBfile, BBrank) renamed sq_make, sq_file,
  sq_rank, moved to board.h (and become temporarily inline funcs)
- different macros/defs moved to "correct place" (bitboard/board/piece):
  board.[ch]: everything related to board/square
  bitboard.[ch]: everything related to bitboards
  piece.[ch]: everything related to pieces
This commit is contained in:
2024-02-11 20:47:09 +01:00
parent 4f25c1416d
commit d5906b1fb9
10 changed files with 208 additions and 164 deletions

23
test/bitboard-test.c Normal file
View File

@@ -0,0 +1,23 @@
//#include "debug.h"
//#include "pool.h"
#include <stdio.h>
#include <string.h>
#include "../src/bitboard.h"
#include "../src/position.h"
#include "../src/piece.h"
//#include "../src/fen.h"
int main(int __unused ac, __unused char**av)
{
char str[128];
bitboard_init();
for (square_t sq = 0; sq < 64; ++sq) {
sprintf(str, "%2d %#lx %#lx knight", sq, sq_bb[sq], knight_attacks[sq]);
bitboard_print(knight_attacks[sq], str);
sprintf(str, "%2d %#lx %#lx knight", sq, sq_bb[sq], king_attacks[sq]);
bitboard_print(king_attacks[sq], str);
}
return 0;
}