Advertisement
Guest User

Untitled

a guest
Oct 15th, 2020
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. handleCommand (Go (BestMove _)) = do
  2.   g <- get
  3.   mv <- lift newEmptyMVar
  4.   tid <- lift $ forkIO $ do
  5.     putMVar mv $ search g 1
  6.     mapM_ (swapMVar mv . search g) [2..]
  7.   lift $ threadDelay 2000000
  8.   lift $ putStrLn "killing"
  9.   lift $ killThread tid
  10.   move <- lift $ takeMVar mv
  11.   lift $ putStr "bestmove "
  12.   lift $ pp move
  13.   lift $ putStrLn ""
  14.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement