fen

package
v0.0.0-...-786fda4 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package fen implements encoding and decoding of Forsyth-Edwards Notation (FEN) as defined in "Standard: Portable Game Notation Specification and Implementation Guide", revision 1994.03.12.

Notably, this package is compliant with §16.1.3.4 and will encode an en passant target square "if and only if the last move was a pawn advance of two squares [...] even if there is no pawn of the opposing side that may immediately execute the en passant capture".

Index

Constants

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

Starting is the FEN string for the starting position.

Variables

This section is empty.

Functions

func Decode

func Decode(s string) (core.Position, error)

Decode decodes a FEN string and returns the position it represents.

func Encode

func Encode(p core.Position) string

Encode encodes a position as a FEN string.

func MustDecode

func MustDecode(s string) core.Position

MustDecode is like Decode but panics if the FEN is invalid.

Types

This section is empty.

Jump to

Keyboard shortcuts

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