pos: keep possibility to have opponent moves (NULL move)

This commit is contained in:
2023-06-25 16:02:23 +02:00
parent 1e4af66379
commit 09ceca44e5
2 changed files with 6 additions and 4 deletions

View File

@@ -176,7 +176,8 @@ pos_t *pos_get()
INIT_LIST_HEAD(&pos->pieces[WHITE]);
INIT_LIST_HEAD(&pos->pieces[BLACK]);
INIT_LIST_HEAD(&pos->moves);
INIT_LIST_HEAD(&pos->moves[WHITE]);
INIT_LIST_HEAD(&pos->moves[BLACK]);
pos_clear(pos);
} else {
fprintf(stderr, "zobaaa\n");
@@ -197,7 +198,8 @@ pos_t *pos_dup(pos_t *pos)
*new = *pos;
INIT_LIST_HEAD(&new->pieces[WHITE]);
INIT_LIST_HEAD(&new->pieces[BLACK]);
INIT_LIST_HEAD(&new->moves);
INIT_LIST_HEAD(&new->moves[WHITE]);
INIT_LIST_HEAD(&new->moves[BLACK]);
/* duplicate piece list */
for (int color=0; color<2; ++color) {

View File

@@ -27,7 +27,6 @@ typedef struct pos_s {
castle_t castle;
u16 clock_50;
u16 curmove;
u16 mobility[2];
eval_t eval;
board_t board[BOARDSIZE];
@@ -37,8 +36,9 @@ typedef struct pos_s {
bitboard_t bb[2][BB_END]; /* use: pieces[BLACK][BB_PAWN] */
bitboard_t occupied[2]; /* OR of bb[COLOR][x] */
bitboard_t controlled[2];
u16 mobility[2];
struct list_head pieces[2];
struct list_head moves;
struct list_head moves[2];
} pos_t;
void bitboard_print(bitboard_t bb);