notation: Index | Files | Directories

package notation

import ""

Package notation implements parsing of chess positions.

Current supported formats are FEN and EPD notations. For EPD format see For FEN format see


Package Files


type EPD Uses

type EPD struct {
    Position   *Position         // first 4 fields
    Id         string            // id
    BestMove   []Move            // bm
    AvoidMove  []Move            // am
    Comment    map[string]string // c0-c9
    Evaluation *int32            // ce, centipawn evaluation if not nil

EPD contains a parsed chess position in Extended Position Description.

func (*EPD) String Uses

func (e *EPD) String() string

type EPDScanner Uses

type EPDScanner struct {
    // contains filtered or unexported fields

EPDScanner parses an input line by line and returns EPDs.

func NewEPDScanner Uses

func NewEPDScanner(r io.Reader, p Parser) *EPDScanner

NewEPDScanner returns a new scanner that reads epds from file one by one.

func (*EPDScanner) EPD Uses

func (es *EPDScanner) EPD() *EPD

EPD returns the parsed position.

func (*EPDScanner) Err Uses

func (es *EPDScanner) Err() error

Err returns the last error.

func (*EPDScanner) Scan Uses

func (es *EPDScanner) Scan() bool

Scan returns true if there was a new EPD read. If the EPD parsing erroneous then Scan returns true and sets the error.

type Parser Uses

type Parser interface {
    Parse(line string) (*EPD, error)

Parser parses a string and returns an EPD.


epdPackage epd implementes a parser for chess positions in EPD format.
fenPackage fen implementes a parser for chess positions in FEN format.
sanPackage moves provides functionally to parse a move in SAN representation.

Package notation imports 5 packages (graph) and is imported by 7 packages. Updated 2019-05-15. Refresh now. Tools for package owners.