pgn

package
v1.55.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GameResultNone     = "*"
	GameResultWhiteWin = "1-0"
	GameResultBlackWin = "0-1"
	GameResultDraw     = "1/2-1/2"
)

Variables

This section is empty.

Functions

func TagValue added in v1.55.0

func TagValue(tags []Tag, key string) (string, bool)

func WalkPgnFile added in v1.55.0

func WalkPgnFile(
	filepath string,
	onGame func(GameRaw) error,
) error

Types

type Comment

type Comment struct {
	Depth int
	Score common.UciScore
}

type Game

type Game struct {
	Result string
	Fen    string
	Items  []Item
}

func ParseGame

func ParseGame(gameRaw GameRaw) (Game, error)

type GameRaw added in v1.55.0

type GameRaw struct {
	Tags    []Tag
	BodyRaw string
}

type Item

type Item struct {
	Move common.Move
	Comment
}

type Tag

type Tag struct {
	Key   string
	Value string
}

Jump to

Keyboard shortcuts

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