chessIO-0.2.0.0: Basic chess move generation and UCI client library

Safe HaskellNone
LanguageHaskell2010

Game.Chess.UCI

Contents

Synopsis

Exceptions

The Engine data type

Starting and quitting a UCI engine

start :: String -> [String] -> IO (Maybe Engine) Source #

Start a UCI engine with the given executable name and command line arguments.

start' :: Int -> (String -> IO ()) -> String -> [String] -> IO (Maybe Engine) Source #

Start a UCI engine with the given timeout for initialisation.

If the engine takes more then the given microseconds to answer to the initialisation request, Nothing is returned and the external process will be terminated.

send :: ByteString -> Engine -> IO () Source #

Send a command to the engine.

This function is likely going to be removed and replaced by more specific functions in the future.

quit :: Engine -> IO (Maybe ExitCode) Source #

Quit the engine.

Engine options

data Option Source #

Instances
Eq Option Source # 
Instance details

Defined in Game.Chess.UCI

Methods

(==) :: Option -> Option -> Bool #

(/=) :: Option -> Option -> Bool #

Show Option Source # 
Instance details

Defined in Game.Chess.UCI

IsString Option Source # 
Instance details

Defined in Game.Chess.UCI

Methods

fromString :: String -> Option #

setOptionSpinButton :: ByteString -> Int -> Engine -> IO Engine Source #

Set a spin option to a particular value.

Bounds are validated. Make sure you don't set a value which is out of range.

Manipulating the current game information

currentPosition :: Engine -> IO Position Source #

Return the final position of the currently active game.

setPosition :: Engine -> Position -> IO () Source #

Set the starting position of the current game, also clearing any pre-existing history.

addMove :: Engine -> Move -> IO () Source #

Add a Move to the game history.

This function checks if the move is actually legal, and throws a UCIException if it isn't.

move :: Engine -> String -> IO () Source #

Add the given move (in algebraic notation) to the current game.

Reading engine output