Hello beloved coders. My first post - I don't think there's an introduction section and I won't steal your time here.
I was taking my first chess programming steps. But both CuteChess and well as Fritz 18 GUI won't recognize the basic setup of my engine. The protocols don't seem to communicate as the application itself isn't even accepted. I don't think it's the code (you decide). Is there something in some options I have to do to make the application better compatible perhaps? Here's the code, it's C#, the environment is Visual Studio 2022 (updated yesterday june 14th) on a Windows 10 machine:
case "uci":
Console.WriteLine("id name Yourenginename Yourversion");
Console.WriteLine("id author Valmont Bosman");
Console.WriteLine("uciok");
break;
And then, the GUI will probably send isready to your engine, to which the engine must answer readyok - but your code doesn't do that. Note that the GUI may also send isready during engine calculations, and you must answer that as well, i.e. during engine search.
I tried a million times, the engine is simply not recognized. There's no protocol exchange to begin with. I think there's something with compiling. There's nothing wrong with the code itself I believe.
Machariel wrote: ↑Thu Jun 15, 2023 2:16 pmI tried a million times, the engine is simply not recognized. There's no protocol exchange to begin with. I think there's something with compiling.
You can try opening a terminal window and starting the engine within that window. Then enter uci and see whether you get the expected output from the engine. If you have any other UCI engine on your system, you can try the same with that engine and see how it looks in comparison.
I did that. It works fine. It's something in the compile I think. There's nothing wrong with the code.
At worst I have a warning "Warning CS8603 Possible null reference return." It's related to GetLine(), since it can return a NULL in theory. But there's nothing I can do about it. I don't believe this is it.
I tried code like this, and it should totally work, but it doesn't. Even when I attach the debugger using
I never used .NET, but I think the console output needs to be flushed after each Console.WriteLine() with: Console.Out.Flush(); Otherwise these WriteLine() statements will be buffered.
I forgot to update this. Tough day today. Anyway, for .net Core one needs to copy the config file and the dll to the working directory. In .net Framework, this wasn't' necessary. When deploying, one needs to compile this as one file. Those two methods are the solutions.
I figured it out by programming quickly my own overarching app which loaded the "engine" (there was nothing in it but the basic UCI functionality) and used the UCI protocol to communicate with it.
To those who tried to help, thank you. Enjoy the weekend.