sgf

package
v0.0.0-...-043dd78 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package sgf contains functionality for transforming from/to the SGF format.

Index

Constants

This section is empty.

Variables

View Source
var ErrParse = errors.New("error parsing SGF")

Functions

func Parse

func Parse(s string) (*movetree.MoveTree, error)

Parse is a convenience helper to parse sgf strings.

func Serialize

func Serialize(g *movetree.MoveTree) (string, error)

Serialize converts a Game into SGF format. Calls serializeHelper.

Types

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser parses SGFs into MoveTree objects.

func FromReader

func FromReader(r *strings.Reader) *Parser

FromReader creates a parser from a string reader.

func FromString

func FromString(sgf string) *Parser

FromString creates a parser from a string.

func (*Parser) Parse

func (p *Parser) Parse() (*movetree.MoveTree, error)

Parse parses a movetree into a tree of moves, return a movetree or a parsing error.

Jump to

Keyboard shortcuts

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