Selfatari setup_nakade_or_snapback(): Slim down the group loop
[pachi/peepo.git] / fbook.h
blobe7c580df9b3369a0d38f9b8696e79e9a1bec26f3
1 #ifndef ZZGO_FBOOK_H
2 #define ZZGO_FBOOK_H
4 #include "move.h"
6 struct board;
8 /* Opening book (fbook as in "forcing book" since the move is just
9 * played unconditionally if found, or possibly "fuseki book"). */
11 struct fbook {
12 int bsize;
13 int handicap;
15 #define fbook_hash_bits 16 // 1M w/ 32-bit coord_t
16 #define fbook_hash_mask ((1 << fbook_hash_bits) - 1)
17 /* pass == no move in this position */
18 coord_t moves[1<<fbook_hash_bits];
19 hash_t hashes[1<<fbook_hash_bits];
22 coord_t fbook_check(struct board *board);
23 struct fbook *fbook_init(char *filename, struct board *b);
24 void fbook_done(struct fbook *fbook);
26 #endif