alg1_book.h File Reference

#include "belofte.h"

Go to the source code of this file.

Data Structures

struct  st_book
struct  st_book_move
struct  st_book_pos

Defines

#define __ALG1_BOOK_H__
#define BOOK_DEPTH   30
 the branch size is 30 bytes times the branching factor (20) ( the book size is the 136 plus the branch size ) times the book size a value of book-size of 700000 will occupy appoximately 512 MB
#define BOOKID   0x4348424B
 CHBK following string is represented as HEX, if the book is created on a little-endian machine, it will be invalid on a big-endian machine because the byte ordering will be different.
#define BOOKRESULT_BLACKWON   2
#define BOOKRESULT_DRAW   0
#define BOOKRESULT_UNKNOWN   -1
#define BOOKRESULT_WHITEWON   1
#define BOOKVERSION   2
 each time we alter the book size, we change the version
#define SIZE_BOOK   200000
#define SIZE_BRANCH   20

Functions

void book_create (const char *szInputFileName, const char *szBinFileName)
 create a book from a pgn file
void book_listmoves (const char *szFen, const t_boolean bShowFen)
 print moves in current posistion it will also check a swap colour
void book_load (const char *szBinFileName)
 load opening book it will do some checking to verify that the binary book is in the correct binary format
int book_move (const char *szFen, char *szMove)
 select a book move in current position return 0 if not a book move, 1 if my book, 2 if generic book it will also check for inverted colours
void book_save (const char *szBinFileName)
 save in memory representation of book into a binary file will be called upon book creation or when ascii version of book is present and binary not


Define Documentation

#define __ALG1_BOOK_H__
 

#define BOOK_DEPTH   30
 

the branch size is 30 bytes times the branching factor (20) ( the book size is the 136 plus the branch size ) times the book size a value of book-size of 700000 will occupy appoximately 512 MB

#define BOOKID   0x4348424B
 

CHBK following string is represented as HEX, if the book is created on a little-endian machine, it will be invalid on a big-endian machine because the byte ordering will be different.

#define BOOKRESULT_BLACKWON   2
 

#define BOOKRESULT_DRAW   0
 

#define BOOKRESULT_UNKNOWN   -1
 

#define BOOKRESULT_WHITEWON   1
 

#define BOOKVERSION   2
 

each time we alter the book size, we change the version

#define SIZE_BOOK   200000
 

#define SIZE_BRANCH   20
 


Function Documentation

void book_create const char *  szInputFileName,
const char *  szBinFileName
 

create a book from a pgn file

void book_listmoves const char *  szFen,
const t_boolean  bShowFen
 

print moves in current posistion it will also check a swap colour

void book_load const char *  szBinFileName  ) 
 

load opening book it will do some checking to verify that the binary book is in the correct binary format

int book_move const char *  szFen,
char *  szMove
 

select a book move in current position return 0 if not a book move, 1 if my book, 2 if generic book it will also check for inverted colours

void book_save const char *  szBinFileName  ) 
 

save in memory representation of book into a binary file will be called upon book creation or when ascii version of book is present and binary not


Generated on Tue Jan 31 00:14:05 2006 for BelofteDoc by  doxygen 1.4.6