0

OS:

Debian GNU/Linux 9.9 (stretch) x86_64

Qt Info:

Qt Creator 4.2.0

Based on Qt 5.7.1 (GCC 6.3.0 20170415, 64 bit)

Program Info:

StockFish 9


I can open a console and interact through commands with Stockfish like so:

./stockfish
 position startpos //Cmd to set default position 
 d // Cmd to get BoardState info 
 position fen [fen code ] moves [e2e4] [e7e5] // Cmd to make moves
 go x     // Cmd to calculate and get best move

I'm trying to make a GUI with QT that can interact with Stockfish to play chess.

I'm not a very experienced programmer and I'm wondering what would be the best way to do this.

At first I thought that I could try and customize the actual stockfish source files and enable it to either communicate with Socat or write in a text file and then retrieve that information.

However, I was wondering if I could make Qt run the program by itself and interact directly with it like I would in the terminal.(write command lines and retrieve the information to use it in the Qt app ).

Is there a Qt class for this or something along those lines?

  • Qt has a QProcess class to execute command line statements, including scripts. Specifically, I know we can execute and launch the stockfish executable. But I am not sure (a guess) if it would be possible to interact with the application, unless there is an API for some kind. Maybe someone who knows about this can shed light on whether or not it could be done by developing some of parser. – Aditya Apr 23 '19 at 16:28
  • Related, probably a dupe: https://stackoverflow.com/q/27051773/4748017. Basically, use UCI – Herb Apr 24 '19 at 15:26

0 Answers0