Skip to content

Latest commit

 

History

History
33 lines (23 loc) · 749 Bytes

File metadata and controls

33 lines (23 loc) · 749 Bytes

opening

opening provides interactivity to opening books such as Encyclopaedia of Chess Openings (ECO) which is loadable from the package. Source: https://github.com/lichess-org/chess-openings

Visual

Advance Variation subtree of the French Defense:

subtree

Example

package main

import (
    "fmt"

    "github.com/corentings/chess"
    "github.com/corentings/chess/opening"
)

func main(){
    g := chess.NewGame()
	g.PushNotationMove("e4", chess.AlgebraicNotation{}, nil)
	g.PushNotationMove("e6", chess.AlgebraicNotation{}, nil)

	// print French Defense
	book := opening.NewBookECO()
	o := book.Find(g.Moves())
	fmt.Println(o.Title())
}