uci_position {bigchess}R Documentation

Sending command position for chess engine

Description

Sending command position for chess engine. Info about position command from http://wbec-ridderkerk.nl/html/UCIProtocol.html set up the position described in fenstring on the internal board and play the moves on the internal chess board. if the game was played from the start position the string "startpos" will be sent Note: no "new" command is needed. However, if this position is from a different game than the last position sent to the engine, the GUI should have sent a "ucinewgame" inbetween.

Usage

uci_position(engine, moves = NULL, startpos = TRUE, fen = NULL)

Arguments

engine

engine object

moves

string in long algebraic notation

startpos

boolean default TRUE

fen

string

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_position(e,moves = "e2e4")
e <- uci_go(e,depth = 10)
uci_quit(e)
# Using pipe '%>%' from magrittr:
require(magrittr)
uci_engine(engine_path) %>% uci_position(moves = "e2e4") %>%
  uci_go(depth = 10) %>% uci_quit() %>% uci_parse()

[Package bigchess version 1.9.1 Index]