chess_puzzle_generator

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2021 License: MIT Imports: 5 Imported by: 0

README

Chess puzzle generators

Provides methods for generating chess puzzles from pgn.

Provided methods:

  • AnalyzeGame(path string, r io.Reader) ([]Task, error) - creates puzzles from one game from pgn
  • AnalyzeAllGames(path string, r io.Reader) ([]Task, error) - analyzes all games from all games in pgn

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Task

type Task struct {
	StartFEN           string `json:"start_fen"`
	FirstPossibleTurns []Turn `json:"first_possible_turns"`
	IsWhiteTurn        bool   `json:"is_white_turn"`
}

func AnalyzeAllGames

func AnalyzeAllGames(path string, r io.Reader) ([]Task, error)

func AnalyzeGame

func AnalyzeGame(path string, r io.Reader) ([]Task, error)

func (Task) String

func (t Task) String() string

type Turn

type Turn struct {
	SanNotation           string `json:"san_notation"`
	IsLastTurn            bool   `json:"is_last_turn,omitempty"`
	AnswerTurnSanNotation string `json:"answer_turn_san_notation,omitempty"`
	ContinueVariations    []Turn `json:"continue_variations,omitempty"`
}

func (Turn) String

func (t Turn) String() string

Jump to

Keyboard shortcuts

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