diff --git a/.gitignore b/.gitignore index 664848a..39f9245 100644 --- a/.gitignore +++ b/.gitignore @@ -15,9 +15,9 @@ brchess *.s *.old *.save -/test/ +# /test/ /obj/ /lib/ -/.deps/ +/deps/ /notused/ valgrind.out diff --git a/src/brchess.c b/src/brchess.c index 6b9cef3..2661fdf 100644 --- a/src/brchess.c +++ b/src/brchess.c @@ -478,7 +478,6 @@ int do_pvs(pos_t *pos, __unused char *arg) return 1; } -#ifdef BIN_brchess /** main() * options: int brchess(pos_t *pos) @@ -521,4 +520,3 @@ int main(int ac, char **av) return brchess(pos); } -#endif /* BIN_brchess */ diff --git a/src/eval.c b/src/eval.c index ad1f625..0462bd5 100644 --- a/src/eval.c +++ b/src/eval.c @@ -93,37 +93,3 @@ eval_t eval(pos_t *pos) pos->eval = res; return res; } - -#ifdef BIN_eval -#include "fen.h" -#include "move.h" - -int main(int ac, char**av) -{ - pos_t *pos; - eval_t res; - - debug_init(5, stderr, true); - - piece_pool_init(); - moves_pool_init(); - pos_pool_init(); - pos = pos_get(); - - if (ac == 1) { - pos_startpos(pos); - } else { - fen2pos(pos, av[1]); - } - - pos_print(pos); - pos_pieces_print(pos); - - moves_gen_all(pos); - - pos_print(pos); - moves_print(pos, M_PR_SEPARATE); - res = eval(pos); - printf("eval=%d centipawns)\n", res); -} -#endif diff --git a/src/fen.c b/src/fen.c index 2a719c2..86d3206 100644 --- a/src/fen.c +++ b/src/fen.c @@ -173,21 +173,3 @@ pos_t *fen2pos(pos_t *pos, char *fen) # endif return pos; } - -#ifdef BIN_fen -int main(int ac, char**av) -{ - pos_t *pos; - - debug_init(5, stderr, true); - piece_pool_init(); - pos_pool_init(); - pos = pos_get(); - if (ac == 1) { - pos_startpos(pos); - } else { - fen2pos(pos, av[1]); - } - pos_print(pos); -} -#endif diff --git a/src/move.c b/src/move.c index dd5251c..b44ac78 100644 --- a/src/move.c +++ b/src/move.c @@ -882,32 +882,3 @@ void move_undo(pos_t *pos, __unused move_t *move) { pos_del(pos); } - -#ifdef BIN_move -#include "fen.h" -int main(int ac, char**av) -{ - pos_t *pos; - - debug_init(5, stderr, true); - piece_pool_init(); - moves_pool_init(); - pos_pool_init(); - pos = pos_get(); - - if (ac == 1) { - fen2pos(pos, "rnbqkbnr/pppp1ppp/8/4p3/4P3/8/PPPP1PPP/RNBQKBNR w KQkq - 0 2"); - //pos_startpos(pos); - } else { - fen2pos(pos, av[1]); - } - //printf("turn = %d opponent = %d\n", pos->turn, OPPONENT(pos->turn)); - moves_gen_all(pos); - pos_print(pos); - pos_pieces_print(pos); - moves_print(pos, M_PR_SEPARATE); - - //bitboard_print2(castle_squares[0].controlled, castle_squares[1].controlled); - //bitboard_print2(castle_squares[0].occupied, castle_squares[1].occupied); -} -#endif /* BIN_move */ diff --git a/src/piece.c b/src/piece.c index 6bca6f1..b6e4eeb 100644 --- a/src/piece.c +++ b/src/piece.c @@ -116,54 +116,3 @@ int pieces_del(pos_t *pos, short color) # endif return count; } - -#ifdef BIN_piece -#include "fen.h" -int main(int ac, char**av) -{ - pos_t *pos; - printf("zobi\n");fflush(stdout); - debug_init(6, stderr, true); - log_f(5, "kfsjdhg\n"); - pos_pool_init(); - pos = pos_get(); - piece_pool_init(); - - if (ac == 1) { - printf("zoba\n");fflush(stdout); - pos_startpos(pos); - } else { - fen2pos(pos, av[1]); - } - pos_print(pos); - pos_pieces_print(pos); - - printf("0x1c = 11100 = C1-E1:\n"); - bitboard_print(0x1c); - - printf("0x70 = 111 = A1-C1\n"); - bitboard_print(0x70); - - printf("0x0e = 1110 = B1-D1\n"); - bitboard_print(0x0e); - - printf("0x60 = 1100000 = F1-G1\n"); - bitboard_print(0x60); - - printf("A1:\n"); - bitboard_print(A1); - - printf("1:\n"); - bitboard_print(1L); - printf("H1:\n"); - bitboard_print(H1); - printf("C1:\n"); - bitboard_print(C1); - printf("D1:\n"); - bitboard_print(D1); - printf("C1|D1:\n"); - bitboard_print(C1|D1); - printf("H8:\n"); - bitboard_print(H8); -} -#endif diff --git a/src/search.c b/src/search.c index 4e39f22..bb0dd78 100644 --- a/src/search.c +++ b/src/search.c @@ -14,7 +14,7 @@ #include #include -#include +#include "debug.h" #include "move.h" #include "eval.h" diff --git a/test/eval.c b/test/eval.c new file mode 100644 index 0000000..387537c --- /dev/null +++ b/test/eval.c @@ -0,0 +1,35 @@ +#include "debug.h" + +#include "../src/position.h" +#include "../src/eval.h" +#include "../src/fen.h" +#include "../src/move.h" + +int main(int ac, char**av) +{ + pos_t *pos; + eval_t res; + + debug_init(5, stderr, true); + + piece_pool_init(); + moves_pool_init(); + pos_pool_init(); + pos = pos_get(); + + if (ac == 1) { + pos_startpos(pos); + } else { + fen2pos(pos, av[1]); + } + + pos_print(pos); + pos_pieces_print(pos); + + moves_gen_all(pos); + + pos_print(pos); + moves_print(pos, M_PR_SEPARATE); + res = eval(pos); + printf("eval=%d centipawns)\n", res); +} diff --git a/test/fen.c b/test/fen.c new file mode 100644 index 0000000..cb19846 --- /dev/null +++ b/test/fen.c @@ -0,0 +1,20 @@ +#include "debug.h" +#include "pool.h" +#include "../src/position.h" +#include "../src/fen.h" + +int main(int ac, char**av) +{ + pos_t *pos; + + debug_init(5, stderr, true); + piece_pool_init(); + pos_pool_init(); + pos = pos_get(); + if (ac == 1) { + pos_startpos(pos); + } else { + fen2pos(pos, av[1]); + } + pos_print(pos); +} diff --git a/test/move.c b/test/move.c new file mode 100644 index 0000000..d4fabf8 --- /dev/null +++ b/test/move.c @@ -0,0 +1,31 @@ +#include +#include "debug.h" + +#include "../src/fen.h" +#include "../src/move.h" + +int main(int ac, char**av) +{ + pos_t *pos; + + debug_init(5, stderr, true); + piece_pool_init(); + moves_pool_init(); + pos_pool_init(); + pos = pos_get(); + + if (ac == 1) { + fen2pos(pos, "rnbqkbnr/pppp1ppp/8/4p3/4P3/8/PPPP1PPP/RNBQKBNR w KQkq - 0 2"); + //pos_startpos(pos); + } else { + fen2pos(pos, av[1]); + } + //printf("turn = %d opponent = %d\n", pos->turn, OPPONENT(pos->turn)); + moves_gen_all(pos); + pos_print(pos); + pos_pieces_print(pos); + moves_print(pos, M_PR_SEPARATE); + + //bitboard_print2(castle_squares[0].controlled, castle_squares[1].controlled); + //bitboard_print2(castle_squares[0].occupied, castle_squares[1].occupied); +} diff --git a/test/piece.c b/test/piece.c new file mode 100644 index 0000000..dbb6b65 --- /dev/null +++ b/test/piece.c @@ -0,0 +1,55 @@ +#include + +#include "debug.h" + +#include "../src/fen.h" +#include "../src/position.h" +#include "../src/bitboard.h" + +int main(int ac, char**av) +{ + pos_t *pos; + printf("zobi\n");fflush(stdout); + debug_init(6, stderr, true); + log_f(5, "kfsjdhg\n"); + pos_pool_init(); + pos = pos_get(); + piece_pool_init(); + + if (ac == 1) { + printf("zoba\n");fflush(stdout); + pos_startpos(pos); + } else { + fen2pos(pos, av[1]); + } + pos_print(pos); + pos_pieces_print(pos); + + printf("0x1c = 11100 = C1-E1:\n"); + bitboard_print(0x1c); + + printf("0x70 = 111 = A1-C1\n"); + bitboard_print(0x70); + + printf("0x0e = 1110 = B1-D1\n"); + bitboard_print(0x0e); + + printf("0x60 = 1100000 = F1-G1\n"); + bitboard_print(0x60); + + printf("A1:\n"); + bitboard_print(A1); + + printf("1:\n"); + bitboard_print(1L); + printf("H1:\n"); + bitboard_print(H1); + printf("C1:\n"); + bitboard_print(C1); + printf("D1:\n"); + bitboard_print(D1); + printf("C1|D1:\n"); + bitboard_print(C1|D1); + printf("H8:\n"); + bitboard_print(H8); +}