R/uci_read.R

Defines functions uci_read

Documented in uci_read

#' Read current stdout from chess engine
#'
#' Read current stdout from chess engine
#'
#' @param engine engine object
#' @return engine object
#'
#' @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)
#' e <- uci_read(e)
#' e$temp
#' uci_quit(e)}
#' @export
uci_read <- function(engine){
  #prs <- process_read(engine$pipe)$stdout subprocess
  prs <- engine$pipe$read_output_lines()
  if(length(prs)>0) engine$temp <- c(engine$temp,prs)
  return(engine)
}

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.