uci

package
v0.0.0-...-906a36e Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2019 License: MIT Imports: 12 Imported by: 1

Documentation

Overview

Package uci (partly) implements the UCI protocol for communicating with chess engines.

Index

Constants

This section is empty.

Variables

View Source
var CommunicationTimeout time.Duration = 3 * time.Second

CommunicationTimeout is the time to wait for a response from the engine. If the engine fails to respond, it is terminated.

Functions

This section is empty.

Types

type BoolOption

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

func (*BoolOption) Bool

func (b *BoolOption) Bool() bool

func (*BoolOption) Default

func (b *BoolOption) Default() bool

func (*BoolOption) Set

func (b *BoolOption) Set(value string)

func (*BoolOption) SetBool

func (b *BoolOption) SetBool(v bool)

func (*BoolOption) String

func (b *BoolOption) String() string

func (*BoolOption) StringDefault

func (b *BoolOption) StringDefault() string

type Engine

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

Engine represents a running UCI engine.

func Run

func Run(exe string, args []string, logger *log.Logger) (*Engine, error)

Run starts an engine executable, with the given arguments. If logger is not nil, it will be used to log all communication to and from the engine.

func (*Engine) Options

func (e *Engine) Options() map[string]engine.Option

Options implements engine.Engine.

func (*Engine) Ping

func (e *Engine) Ping() error

Ping implements engine.Engine.

func (*Engine) Quit

func (e *Engine) Quit()

Quit implements engine.Engine.

func (*Engine) Search

func (e *Engine) Search() <-chan engine.Info

Search implements engine.Engine.

func (*Engine) SearchClock

func (e *Engine) SearchClock(wtime, btime, winc, binc time.Duration, movesToGo int) <-chan engine.Info

SearchClock implements engine.Engine.

func (*Engine) SearchDepth

func (e *Engine) SearchDepth(depth int) <-chan engine.Info

SearchDepth implements engine.Engine.

func (*Engine) SearchTime

func (e *Engine) SearchTime(t time.Duration) <-chan engine.Info

SearchTime implements engine.Engine.

func (*Engine) Send

func (e *Engine) Send(cmd string) error

Send sends a command to the engine.

func (*Engine) SetPosition

func (e *Engine) SetPosition(board *chess.Board)

SetPosition implements engine.Engine.

func (*Engine) Stop

func (e *Engine) Stop()

Stop implements engine.Engine.

type Info

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

func (Info) BestMove

func (i Info) BestMove() (chess.Move, bool)

func (Info) BestMoveRaw

func (i Info) BestMoveRaw() (string, bool)

func (Info) Err

func (i Info) Err() error

func (Info) Pv

func (i Info) Pv() *engine.Pv

func (Info) Stats

func (i Info) Stats() *engine.Stats

func (Info) Value

func (i Info) Value(key string) (v string, ok bool)

Value returns the value of the given keyword. It returns !ok if the keyword is not present in this info.

type IntOption

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

func (*IntOption) Default

func (i *IntOption) Default() int

func (*IntOption) Int

func (i *IntOption) Int() int

func (*IntOption) Max

func (i *IntOption) Max() int

func (*IntOption) Min

func (i *IntOption) Min() int

func (*IntOption) Set

func (i *IntOption) Set(value string)

func (*IntOption) SetInt

func (i *IntOption) SetInt(v int)

func (*IntOption) String

func (i *IntOption) String() string

func (*IntOption) StringDefault

func (i *IntOption) StringDefault() string

type StringOption

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

func (*StringOption) Set

func (s *StringOption) Set(value string)

func (*StringOption) String

func (s *StringOption) String() string

func (*StringOption) StringDefault

func (s *StringOption) StringDefault() string

Jump to

Keyboard shortcuts

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