Functions for interacting with UCI chess engines.
Functions for interacting with UCI chess engines.
(follow-process-output process action)
Starts up a thread following the output of a process, and calls the provided function 'action' on every output line. The thread keeps running until the process stops running or 'action' returns :finished.
Starts up a thread following the output of a process, and calls the provided function 'action' on every output line. The thread keeps running until the process stops running or 'action' returns :finished.
(parse-uci-output output)
Parse an output line from a UCI chess engine.
Parse an output line from a UCI chess engine.
(run-engine engine-path & [output-action])
Starts the UCI chess engine at the given path name, and returns an engine object (a map) that can be used as argument to the send-command and think functions.
Starts the UCI chess engine at the given path name, and returns an engine object (a map) that can be used as argument to the send-command and think functions.
(send-command engine command)
Sends a UCI command (as a string) to a chess engine.
Sends a UCI command (as a string) to a chess engine.
(think engine go-command bestmove-action & [info-action])
Sends the engine the supplied UCI 'go' command, and starts a new thread to monitor the search output. When the search is completed, the supplied function 'bestmove-action' is called with the engine output (a string of the form 'bestmove xxxx ponder yyyy') as the input parameter, and the monitoring thread exits. The optional 'info-action' parameter is a function which is called on all 'info' output lines that occur during the search.
Sends the engine the supplied UCI 'go' command, and starts a new thread to monitor the search output. When the search is completed, the supplied function 'bestmove-action' is called with the engine output (a string of the form 'bestmove xxxx ponder yyyy') as the input parameter, and the monitoring thread exits. The optional 'info-action' parameter is a function which is called on all 'info' output lines that occur during the search.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close