Documentation
¶
Overview ¶
Package fen contains functions for encoding the board into FEN encoding and vice versa.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrDecoding = errors.New("error decoding FEN string")
ErrDecoding is returned when there is an error decoding a FEN string.
Functions ¶
Types ¶
type FEN ¶ added in v0.5.0
type FEN struct {
// contains filtered or unexported fields
}
func Encode ¶
Encode encodes the given chess board into a FEN string. If the board is nil, it returns an empty string. If MetricFuncs are provided, it appends their results to the FEN string. The format of the FEN string is: <piece placement> <turn> [<metric1> <metric2> ...]. If no metrics are provided, it will only include the piece placement and turn. If metric functions return nil, it will append a dash ("-") for that metric.
func FromString ¶ added in v0.5.0
func (FEN) EnPassantSquare ¶ added in v0.5.0
func (FEN) HalfmoveClock ¶ added in v0.5.0
func (FEN) MoveNumber ¶ added in v0.5.0
Click to show internal directories.
Click to hide internal directories.