NAME
Chess::Opening::Book::Polyglot - Read polyglot opening books
SYNOPSIS
$book = Chess::Opening::Book::Polyglot->new('opening.bin');
$entry = $book->lookupFEN($fen) or die "position not found";
DESCRIPTION
The polyglot openning book format is a popular, open format for chess opening libraries. Chess::Opening::Book::Polyglot can be used for reading these opening books.
A polyglot opening book consists of a list of chess positions, each with a weighted list of possible continuation moves. The "weight" is a measure for the likelihood of a win after that particular move has been made.
There is no arbitrary limit on the size of an opening book that you can read with Chess::Opening::Book::Polyglot as the book is not read as a whole but the positions are searched inside the file and only the relevant part is loaded into memory. This is implemented in a fairly efficient manner. However, if you want to use the module for a chess engine (which you should'nt write in an interpreted language like Perl), you probably want to optimize the lookup a bit.
METHODS
- new FILENAME
-
The constructor takes one single argument, the FILENAME of the opening book on disk. An exception is thrown if the file cannot be opened.
- lookupFEN FEN
COPYRIGHT
Copyright (C) 2019 Guido Flohr <guido.flohr@cantanea.com>, all rights reserved.
SEE ALSO
Chess::Opening::Book, Chess::Opening::Book::Entry, Chess::Opening::Book::Move, perl(1)