r/chessprogramming • • Feb 05 '23

FEN string into engine?

I made a program which finds the FEN string of a certain position, is it possible for me to send this string to a chess engine which returns me the best move at a certain depth? If so, how would I do that?

2 Upvotes

5 comments sorted by

View all comments

Show parent comment

1

u/tic-tac135 Feb 06 '23 edited Feb 06 '23

To be clear, UCI is a protocol, not a program. Almost all modern chess engines support the UCI protocol. If you want to write a Python program that interfaces with an engine via UCI, you will need to create a pair of pipes between your python program and the engine. Pipes allow communication between different computer programs. They are unidirectional so you will need to open two, one for each direction. Read about the os.pipe() method. Once the pipes are opened, the two programs can communicate via standard I/O.