This commit is contained in:
2025-12-17 14:12:00 +01:00
parent 2f65828ae2
commit be5ec8d0dc
3 changed files with 568 additions and 282 deletions

View File

@@ -7,7 +7,7 @@ CFLAGS.gcc.debug := -ggdb -O0 -fsanitize=address
CFLAGS.gcc := -std=c23 -Wall -Wextra -Wconversion -Wno-unused-function CFLAGS.gcc := -std=c23 -Wall -Wextra -Wconversion -Wno-unused-function
CFLAGS.clang.release := -O3 CFLAGS.clang.release := -O3
CFLAGS.clang.debug := -ggdb -O0 CFLAGS.clang.debug := -ggdb -O0 -fsanitize=address
CFLAGS.clang := -std=c23 -Wall -Wextra -Wconversion -Wno-unused-function -Wimplicit-int-conversion CFLAGS.clang := -std=c23 -Wall -Wextra -Wconversion -Wno-unused-function -Wimplicit-int-conversion
CFLAGS := $(CFLAGS.$(CC)) $(CFLAGS.$(CC).$(BUILD)) CFLAGS := $(CFLAGS.$(CC)) $(CFLAGS.$(CC).$(BUILD))

816
base.h

File diff suppressed because it is too large Load Diff

12
tests.c
View File

@@ -361,9 +361,14 @@ int main()
{ {
printf("sizeof board: %zu\n", sizeof (struct board)); printf("sizeof board: %zu\n", sizeof (struct board));
printf("sizeof pos: %zu\n", sizeof (struct pos));
printf("sizeof mailbox: %zu\n", sizeof (struct board){0}.mailbox);
printf("sizeof tt: %zu\n", sizeof (struct tt));
#if 0
test_rooks(); test_rooks();
test_bishops(); test_bishops();
#endif
for (int i = 40; i < 47; i++) { for (int i = 40; i < 47; i++) {
fprintf(stdout, "\033[30;%dm ", i); fprintf(stdout, "\033[30;%dm ", i);
@@ -372,7 +377,8 @@ int main()
struct board board = BOARD_INITIAL; struct board board = BOARD_INITIAL;
//board_load_fen_unsafe(&board, "1n1q1rk1/r1p2P2/1p1pp2p/pB2P3/2P5/PPN5/6b1/3QK1NR b - - 0 1"); //board_load_fen_unsafe(&board, "1n1q1rk1/r1p2P2/1p1pp2p/pB2P3/2P5/PPN5/6b1/3QK1NR b - - 0 1");
//board_print_fen(&board, stdout); board_load_fen_unsafe(&board, "5R2/7k/P7/6pp/3B4/1PPK2bP/4r3/8 b - - 3 57");
board_print_fen(&board, stdout);
board_print(&board.pos, NULL, stdout); board_print(&board.pos, NULL, stdout);
struct move moves[MOVE_MAX]; struct move moves[MOVE_MAX];
@@ -390,7 +396,7 @@ int main()
} }
//struct move move = moves[0]; //struct move move = moves[0];
struct move move = search(&board, board.pos.player, 6); struct move move = search(&board, board.pos.player, 7);
printf("move %d: {\n" printf("move %d: {\n"
" .from = %s, (%s)\n" " .from = %s, (%s)\n"
@@ -408,6 +414,8 @@ int main()
enum move_result const r = board_move_2(&board, move); enum move_result const r = board_move_2(&board, move);
#if 1 #if 1
board_print_fen(&board, stdout);
print_stats(stdout);
board_print(&board.pos, &move, stdout); board_print(&board.pos, &move, stdout);
#endif #endif