Lines Matching defs:book
19 File: book.c
20 Purpose: book initialization, selection of book moves, etc...
28 char book[4000][161];
43 /* simply read all the book moves into a book array. The book will be
44 a simple char[5000][81] array (5000 max book lines, since you can't
47 transpositions and such ;) Returns true if reading in the book
57 memset(book, 0, sizeof(book));
101 if (ch == '\n') { /* end of book line */
103 /* not ending an empty book line */
106 book[i++][j] = '\0';
150 else if (j < 160 && i < 4000) /* middle of book line */
152 book[i][j++] = ch;
155 /* If j >= 100, then the book line was too long. The rest will be
157 '\n' is read. If i >= 2000, then there are too many book lines.
172 /* Since the book is sorted alphabetically, we can use strncpy, and hope
173 to get early exits once we've found the first few moves in the book.
174 Once we choose a book move, we'll make a variable indicate where
196 if (!strncmp(opening_history, book[i], (book_ply * 4)) || (!book_ply)) {
197 /* if book move is legal, add it to possible list of book moves */
216 strncpy(possible_move, book[i] + (book_ply * 4), 4);
238 /* we can exit the search for a book move early, if we've no longer
244 /* now, if we have some book replies, pick our move randomly from