Documentation
¶
Overview ¶
Package uci describes the Universal Chess Interface (UCI) protocol.
Index ¶
Constants ¶
View Source
const ( ScoreTypeCentipawn = "cp" ScoreTypeMate = "mate" )
Score types used in ResponseInfo.
Variables ¶
View Source
var ErrEngineClosed = errors.New("engine closed")
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine interface {
// Do blocks until the request is completed or an error occurs.
Do(req Request) error
// Respond returns and consumes the oldest response from the engine.
// It blocks until a response is available or an error occurs.
Respond() (Response, error)
// Close closes the engine. Any blocked Do or Respond calls will be
// unblocked and return ErrEngineClosed.
Close() error
}
type Request ¶
type Request interface {
encoding.TextUnmarshaler
}
A Request is a command sent from the client to the engine.
type RequestGo ¶
type RequestGo struct {
SearchMoves []string // Restrict search to these moves only. Ignore if empty.
Ponder bool // Search in pondering mode.
Infinite bool // Search until interrupted.
MoveTime int // If > 0, search for this many milliseconds.
WhiteTime int // If > 0, white's remaining time in milliseconds.
BlackTime int // If > 0, black's remaining time in milliseconds.
WhiteIncrement int // If > 0, white's increment in milliseconds.
BlackIncrement int // If > 0, black's increment in milliseconds.
Depth int // If > 0, search this many plies only.
Nodes int // If > 0, search this many nodes only.
Mate int // If > 0, search for a mate in this many moves.
MovesToGo int // If > 0, there are this many moves until the next time control.
}
RequestGo represents the "go" command.
func (*RequestGo) UnmarshalText ¶
type RequestIsReady ¶
type RequestIsReady struct{}
RequestIsReady represents the "isready" command.
func (*RequestIsReady) UnmarshalText ¶
func (req *RequestIsReady) UnmarshalText(text []byte) error
type RequestPosition ¶
RequestPosition represents the "position" command.
func (*RequestPosition) UnmarshalText ¶
func (req *RequestPosition) UnmarshalText(text []byte) error
type RequestUCI ¶
type RequestUCI struct{}
RequestUCI represents the "uci" command.
func (*RequestUCI) UnmarshalText ¶
func (req *RequestUCI) UnmarshalText(text []byte) error
type Response ¶
type Response interface {
encoding.TextMarshaler
}
A Response is a command sent from the engine to the client.
type ResponseBestMove ¶
ResponseBestMove represents the "bestmove" command.
func (ResponseBestMove) MarshalText ¶
func (resp ResponseBestMove) MarshalText() ([]byte, error)
type ResponseID ¶
ResponseID represents the "id" command.
func (ResponseID) MarshalText ¶
func (resp ResponseID) MarshalText() ([]byte, error)
Click to show internal directories.
Click to hide internal directories.