Skip to content

Since chess uci is no longer supported, what is a simple fix for older code that uses this module? #848

Answered by niklasf
infinitless asked this question in Q&A
Discussion options

You must be logged in to vote

The new chess.engine module can do everything that chess.uci could and vice versa, but there is no mechanical recipe to convert from chess.uci to chess.engine. However, usually the process is straight-foward. In this case:

  1. chess.uci.popen_engine(path) becomes chess.engine.SimpleEngine.popen_uci(path), if you do not intend to use asyncio.
  2. InfoHandler has been removed. No need to register one, anymore.
  3. engine.position(board) and engine.go(time=time_in_millis) for the purpose of analysis is now a single call info = engine.analyse(board, chess.engine.Limit(time=time_in_seconds)).
  4. info["pv"][0] is the best move according to the engine.
  5. info["score"] will be a PovScore, that you can use to get…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@TomHagenWills
Comment options

@infinitless
Comment options

@TomHagenWills
Comment options

@infinitless
Comment options

Answer selected by infinitless
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants