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?
Step 1: To open the console in Chrome, use this keyboard shortcut: "Cmd + Option + J" (on a Mac) or "Ctrl +Shift +J" (on Windows). As an alternative, you can right-click on the webpage and click "Inspect" to open the developer console.
If you do not know what I am talking about: press Win+R, type “help” and press ENTER. A black console window will open, execute the HELP command and close again. Often, this is not desired. Instead, the command should execute without any visible window.
An application that uses the command line for input and output rather than a graphical interface (GUI). For example, utility programs that perform a single function or that run in the background are often written as console apps.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With