uci_go {bigchess}R Documentation

Sending command go for chess engine

Description

Sending command go for chess engine. Info about go command from http://wbec-ridderkerk.nl/html/UCIProtocol.html start calculating on the current position set up with the "position" command. There are a number of commands that can follow this command, all will be sent in the same string. If one command is not send its value should be interpreted as it would not influence the search.

Usage

uci_go(
  engine,
  depth = NULL,
  infinite = FALSE,
  stoptime = 1,
  wtime = NULL,
  btime = NULL,
  winc = NULL,
  binc = NULL
)

Arguments

engine

engine object

depth

integer depth (search x plies only)

infinite

boolean default FALSE. If TRUE, stoptime (next argument) should be defined

stoptime

integer default 1. Used in Sys.sleep after go infinite in egine. After this, uci_stop() is executed

wtime

integer default NULL (white has x msec left on the clock)

btime

integer default NULL (black has x msec left on the clock)

winc

integer default NULL (white increment per move in mseconds if x > 0)

binc

integer default NULL (black increment per move in mseconds if x > 0)

Value

engine object

Examples


# Linux (make sure you have executable permission):
engine_path <- "./stockfish_10_x64"
# Windows
# engine_path <- "./stockfish_10_x64.exe"
e <- uci_engine(engine_path)
e <- uci_go(e,depth = 10)
uci_quit(e)
# Using pipe '%>%' from magrittr:
require(magrittr)
uci_engine(engine_path) %>% uci_go(depth = 10) %>% uci_quit()
# Find best answer for black after 1. e4 in 100 seconds:
uci_engine(engine_path) %>% uci_position(moves = "e2e4") %>%
  uci_go(depth = 20) %>% uci_quit() %>% uci_parse()
# Find best answer for black after 1. e4 in 100 seconds:
uci_engine(engine_path) %>% uci_position(moves = "e2e4") %>%
  uci_go(infinite = TRUE,stoptime = 100) %>% uci_quit() %>% uci_parse()

[Package bigchess version 1.9.1 Index]