diff options
Diffstat (limited to 'include/tak.h')
| -rw-r--r-- | include/tak.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/tak.h b/include/tak.h index d60c221..324c41f 100644 --- a/include/tak.h +++ b/include/tak.h @@ -55,6 +55,9 @@ typedef struct tak_state_s { enum WIN_TYPE won; enum COLOUR current_colour; uint8_t white_count, black_count, ply, board_size; + // incremental zobrist hash; maintained by action_take/action_undo and + // re-anchored at the search root (see zobrist.h) + uint64_t hash; } *tak_state_p; #define NUM_SHIFT 4 @@ -63,6 +66,8 @@ typedef struct tak_state_s { #define STONE_MASK 3 // 0b00000011 #define STONE_AT(state, l) (state->celldat[(l)] & STONE_MASK) #define COUNT_AT(state, l) (state->celldat[(l)] >> NUM_SHIFT) +// the colour stack holds one bit per stone, the top stone in the LSB +#define TOP_COLOUR_AT(state, l) (state->colours[(l)] & 1) #define THE_COORDS(board_size, col, row) ((col) + (row)*board_size) // =================================================================== |
