fen

package
v0.91.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package fen contains utilities for read and writing positions in FEN notation.

Index

Constants

View Source
const (
	Initial = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"
)

Variables

This section is empty.

Functions

func Decode

func Decode(fen string) (*board.Position, board.Color, int, int, error)

Decode returns a new position and game status from a FEN description.

Example:

"rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"

func Encode

func Encode(pos *board.Position, c board.Color, noprogress, fullmoves int) string

Encode encodes the position and game data in FEN notation.

func NewBoard

func NewBoard(startpos string, moves ...string) (*board.Board, error)

NewBoard returns a Board for the position with moves. Convenience function.

func Strip

func Strip(pos string) string

Strip returns a FEN position without noprogress and move number. Useful as key.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL