Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data UCIException = IllegalMove Ply
- data Engine
- type BestMove = Maybe (Ply, Maybe Ply)
- name :: Engine -> Maybe ByteString
- author :: Engine -> Maybe ByteString
- start :: String -> [String] -> IO (Maybe Engine)
- start' :: KnownDivRat unit Microsecond => Time unit -> (String -> IO ()) -> String -> [String] -> IO (Maybe Engine)
- data Option
- = CheckBox Bool
- | ComboBox { }
- | SpinButton { }
- | OString ByteString
- | Button
- options :: Engine -> HashMap ByteString Option
- getOption :: ByteString -> Engine -> Maybe Option
- setOptionSpinButton :: MonadIO m => ByteString -> Int -> Engine -> m Engine
- setOptionString :: MonadIO m => ByteString -> ByteString -> Engine -> m Engine
- isready :: Engine -> IO ()
- currentPosition :: MonadIO m => Engine -> m Position
- setPosition :: MonadIO m => Engine -> Position -> m (Position, [Ply])
- addPly :: MonadIO m => Engine -> Ply -> m ()
- replacePly :: MonadIO m => Engine -> Ply -> m ()
- data Info
- data Score
- = CentiPawns Int
- | MateIn Int
- data Bounds
- search :: MonadIO m => Engine -> [SearchParam] -> m (TChan BestMove, TChan [Info])
- searching :: MonadIO m => Engine -> m Bool
- data SearchParam
- searchmoves :: [Ply] -> SearchParam
- ponder :: SearchParam
- timeleft :: KnownDivRat unit Millisecond => Color -> Time unit -> SearchParam
- timeincrement :: KnownDivRat unit Millisecond => Color -> Time unit -> SearchParam
- movestogo :: Natural -> SearchParam
- movetime :: KnownDivRat unit Millisecond => Time unit -> SearchParam
- nodes :: Natural -> SearchParam
- depth :: Natural -> SearchParam
- infinite :: SearchParam
- ponderhit :: MonadIO m => Engine -> m ()
- stop :: MonadIO m => Engine -> m ()
- quit :: MonadIO m => Engine -> m (Maybe ExitCode)
- quit' :: (KnownDivRat unit Microsecond, MonadIO m) => Time unit -> Engine -> m (Maybe ExitCode)
Exceptions
data UCIException Source #
Instances
Show UCIException Source # | |
Defined in Game.Chess.UCI showsPrec :: Int -> UCIException -> ShowS # show :: UCIException -> String # showList :: [UCIException] -> ShowS # | |
Exception UCIException Source # | |
Defined in Game.Chess.UCI |
The Engine data type
Starting a UCI engine
start :: String -> [String] -> IO (Maybe Engine) Source #
Start a UCI engine with the given executable name and command line arguments.
start' :: KnownDivRat unit Microsecond => Time unit -> (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.
Engine options
setOptionSpinButton :: MonadIO m => ByteString -> Int -> Engine -> m 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.
setOptionString :: MonadIO m => ByteString -> ByteString -> Engine -> m Engine Source #
Manipulating the current game information
currentPosition :: MonadIO m => Engine -> m Position Source #
Return the final position of the currently active game.
Set the starting position of the current game, also clearing any pre-existing history.
addPly :: MonadIO m => Engine -> Ply -> m () 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.
The Info data type
Searching
search :: MonadIO m => Engine -> [SearchParam] -> m (TChan BestMove, TChan [Info]) Source #
Instruct the engine to begin searching.
data SearchParam Source #
Instances
Eq SearchParam Source # | |
Defined in Game.Chess.UCI (==) :: SearchParam -> SearchParam -> Bool # (/=) :: SearchParam -> SearchParam -> Bool # | |
Show SearchParam Source # | |
Defined in Game.Chess.UCI showsPrec :: Int -> SearchParam -> ShowS # show :: SearchParam -> String # showList :: [SearchParam] -> ShowS # |
searchmoves :: [Ply] -> SearchParam Source #
ponder :: SearchParam Source #
timeleft :: KnownDivRat unit Millisecond => Color -> Time unit -> SearchParam Source #
timeincrement :: KnownDivRat unit Millisecond => Color -> Time unit -> SearchParam Source #
movestogo :: Natural -> SearchParam Source #
movetime :: KnownDivRat unit Millisecond => Time unit -> SearchParam Source #
nodes :: Natural -> SearchParam Source #
depth :: Natural -> SearchParam Source #
ponderhit :: MonadIO m => Engine -> m () Source #
Switch a ponder search to normal search when the pondered move was played.
Quitting
quit' :: (KnownDivRat unit Microsecond, MonadIO m) => Time unit -> Engine -> m (Maybe ExitCode) Source #