R/uci_quit.R

Defines functions uci_quit

Documented in uci_quit

#' Sending quit command to chess engine
#'
#' Sending quit command to chess engine and cleaning temps from R
#'
#' @param engine engine object
#' @return strings from uci chess engine GUI
#'
#' @examples
#'\donttest{
#' # Linux (make sure you have executable permission):
#' engine_path <- "./stockfish_10_x64"
#' # Windows
#' # engine_path <- "./stockfish_10_x64.exe"
#' e <- uci_engine(engine_path)
#' uci_quit(e)
#' # Using pipe '%>%' from magrittr:
#' require(magrittr)
#' uci_engine(engine_path) %>% uci_quit()}
#' @export
uci_quit <- function(engine){
  uci_cmd(engine,"quit")
  # process_close_input(engine$pipe) #subprocess

  rslt <- uci_read(engine)$temp
  engine$pipe$kill()
  return(rslt)
}

Try the bigchess package in your browser

Any scripts or data that you put into this service are public.

bigchess documentation built on Aug. 5, 2020, 5:09 p.m.