Documentation ¶
Index ¶
- Constants
- type Engine
- func (eng *Engine) Close()
- func (eng *Engine) Go(depth int, searchmoves string, movetime int64, resultOpts ...uint) (*Results, error)
- func (eng *Engine) GoDepth(depth int, resultOpts ...uint) (*Results, error)
- func (eng *Engine) SendOption(name string, value interface{}) error
- func (eng *Engine) SetFEN(fen string) error
- func (eng *Engine) SetMoves(moves string) error
- func (eng *Engine) SetOptions(opt Options) error
- type Options
- type Results
- type ScoreResult
Constants ¶
const ( HighestDepthOnly uint = 1 << iota // only return the highest depth results IncludeUpperbounds uint = 1 << iota // include upperbound results IncludeLowerbounds uint = 1 << iota // include lowerbound results )
constants for result filtering
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine holds the information needed to communicate with a chess engine executable. Engines should be created with a call to NewEngine(/path/to/executable)
func (*Engine) Go ¶
func (eng *Engine) Go(depth int, searchmoves string, movetime int64, resultOpts ...uint) (*Results, error)
Go can use search moves, depth and time to move as filter for the results being returned. see http://wbec-ridderkerk.nl/html/UCIProtocol.html
func (*Engine) GoDepth ¶
GoDepth takes a depth and an optional uint flag that configures filters for the results being returned.
func (*Engine) SendOption ¶
SendOption sends setoption command to the Engine
func (*Engine) SetOptions ¶
SetOptions sends setoption commands to the Engine for the values set in the Options record passed in
type Options ¶
type Options struct { MultiPV int // number of principal variations (ranks top X moves) Hash int // hash size in MB Ponder bool // whether the engine should ponder OwnBook bool // whether the engine should use its opening book Threads int // max number of threads the engine should use }
Options, for initializing the chess engine
type Results ¶
type Results struct { BestMove string Results []ScoreResult // contains filtered or unexported fields }
Results holds a slice of ScoreResult records as well as some overall result data
type ScoreResult ¶
type ScoreResult struct { Time int // time spent to get this result (ms) Depth int // depth (number of plies) of result record SelDepth int // selective depth -- some engines don't report this Nodes int // total nodes searched to get this result NodesPerSecond int // current nodes per second rate MultiPV int // 0 if MultiPV not set Lowerbound bool // true if reported as lowerbound Upperbound bool // true if reported as upperbound Score int // score centipawns or mate in X if Mate is true Mate bool // whether this move results in forced mate BestMoves []string // best line for this result }
ScoreResult holds the score result records returned by the engine