Author: Don Dailey
Date: 11:36:26 05/28/98
Go up one level in this thread
On May 27, 1998 at 16:45:38, Jens Baek Nielsen wrote: >My chessprogram Dabbaba needs an openingbook. >See below - is this the right way to make it? > >I consider having a textfile like in this format: >e2e4# e7e5# g1f3# b8c6#... >---- ---- ---- g8f6#... >---- c7c5#... >d2d4#... >( the # could be a mark as in Genius (!/-/./ ) to indicate how often a >move should be played) > >=====>Does such a textfile exist, that everybody can copy and use? > >A program DABBBOOK.EXE should read this textfile and generate a file >DABBABA.BOK like this, that Dabbaba uses as its book: > 8 bytes hashkey > 1 byte from > 1 byte to > 1 byte for the #-mark. >------- > 11 bytes pr. position; ca. 9.000 positions in 100K. >By using the hashkey much space is required, but transpositions are >handled. > >Greetings Jens (jensbaek@silkeborg.bib.dk) Here is what I do: The book is a collection of positions which are stored on disk. You could read them in from pgn or use any other format. I use a big large fen file, but with other information attached. As I read them in, I hash them into a simple hash table with pointers to the file on disk. Even though the book is a text file, you can have a pointer point to each record (line) in the file. All I keep in memory is a key and the pointer and I don't even need to keep the key in memory. The hash table in memory I write out to disk for quick loading. If your book gets really enormous you could just as well put the index file on disk too. It's not the most elegant possible scheme but it's very simple to implement and fast. Disk access time is fast and I never wait a noticable length of time for a book move. - Don
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.