The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Chess::Opening::ECO::Entry - ECO information for a position.

SYNOPSIS

        $book = Chess::Opening::Book::ECO->new;
        $entry = $book->lookupFEN($fen) or die "position not found";

        $eco = $entry->eco;
        $variation = $entry->variation;
        $total = $entry->weights;
        $total = $entry->counts;
        $moves = $entry->moves;

        $entry->addMove(move => 'g1f3', count => 2304);
    

DESCRIPTION

Chess::Opening::ECO::Entry is a specialization of Chess::Opening::Book::Entry for the ECO classification.

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

Returns a Chess::Opening::Book::Entry for FEN or false. See "lookupFEN" in Chess::Opening::Book for more information

moves

Returns a reference to a hash of Chess::Opening::Book::Move objects for this position. The keys are the moves in coordinate notation (see "Moves" in Chess::Opening) and the values are the associated objects.

eco

The ECO code for this position.

variation

The name of the opening, for example "Spanish", "Reti" and so on.

xeco

The extended ECO code for this position. The extended ECO code is the normal echo code possibly followed by a lowercase letter, possibly followed by a decimal number. See http://scidvspc.sourceforge.net/doc/ECO.htm for a description of these extensions.

weights

Since each move in the ECO database has a "weight" of 1, this just returns the number of moves.

counts

An alias weights(), see above.

addMove move => MOVE, weight => WEIGHT

Adds a MOVE in coordinate notation with weight WEIGHT. You can use the named argument count as an alias for weight.

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)