KalEl
KalEl

Reputation: 9146

Starting and Communicating with console apps from a GUI

I want to make a GUI for chess in C#. The modern freely available engines use the UCI interface, which runs as a standalone console application and communicates through text commands and outputs.

How can I run console programs (these chess engines) in background transparently to the user of my GUI, and communicate with them?

Upvotes: 5

Views: 3819

Answers (1)

Reed Copsey
Reed Copsey

Reputation: 564851

Just start the console process using ProcessStartInfo.RedirectStandardInput and RedirectStandardOutput, and read and write to the input/output as needed.

Here is an article describing the full process.

Upvotes: 13

Related Questions