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:
23
test/bitboard-test.c
Normal file
23
test/bitboard-test.c
Normal 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;
|
||||
}
|
Reference in New Issue
Block a user