Ideas of engines written in C#

Discussion of chess software programming and technical issues.

Moderator: Ras

Peperoni
Posts: 72
Joined: Sun Nov 01, 2020 5:27 pm
Full name: Richard Porti

Re: Ideas of engines written in C#

Post by Peperoni »

Thanks you very much for your very useful insights emadsen and dangi, I am a C++ developper I am not familiar with .NET stuff, Core, Standard, Framework ...
I was able to compile Leorik targetting .NET standard 2.1, I needed to do some small changes in the code but it was pretty smooth overall.
Now I need to understand how to build a wrapper like that around it:

class EngineInterface {
Action onNewLine; //called each time engine output a new line

bool start(); //start engine
void stop(); //stop engine

bool startListening(); //if listening call onNewline each time engine output lines, other wise, readLine should be called
bool stopListening();
bool isListening();
bool write(string uciCommand);
string readLine(int timeout);
}

I will also try with MadChess :)
User avatar
lithander
Posts: 915
Joined: Sun Dec 27, 2020 2:40 am
Location: Bremen, Germany
Full name: Thomas Jahn

Re: Ideas of engines written in C#

Post by lithander »

Hi Richard, good to hear you got Leorik to compile for Unity. I already replied to the issue you created on github: https://github.com/lithander/Leorik/issues/5
Minimal Chess (simple, open source, C#) - Youtube & Github
Leorik (competitive, in active development, C#) - Github & Lichess
Peperoni
Posts: 72
Joined: Sun Nov 01, 2020 5:27 pm
Full name: Richard Porti

Re: Ideas of engines written in C#

Post by Peperoni »

Haha yes :) I sent you an email :)
Thank you once again !
lithander wrote: Sat Mar 25, 2023 4:19 pm Hi Richard, good to hear you got Leorik to compile for Unity. I already replied to the issue you created on github: https://github.com/lithander/Leorik/issues/5
Peperoni
Posts: 72
Joined: Sun Nov 01, 2020 5:27 pm
Full name: Richard Porti

Re: Ideas of engines written in C#

Post by Peperoni »

emadsen wrote: Fri Mar 24, 2023 6:37 pm
Peperoni wrote: Fri Mar 24, 2023 5:30 pm If I wanted to adapt it for .NET 4 , do you think that would be a lot of work?
I don't think so. It has no significant NuGet package dependencies other than for unit tests. I don't believe it references many .NET 7 specific APIs. Perhaps you'll have difficulties with the System.Numerics namespace. I don't know. I haven't written .NET 4 code in years.

Why would you want to backport the code to a 13 year old runtime?
Just compiled it, needed to adapt the namespaces and rewrite sime BitOperations methods, was very smooth ;)
Thank you!
User avatar
emadsen
Posts: 440
Joined: Thu Apr 26, 2012 1:51 am
Location: Oak Park, IL, USA
Full name: Erik Madsen

Re: Ideas of engines written in C#

Post by emadsen »

Peperoni wrote: Sun Mar 26, 2023 7:17 pm Just compiled it, needed to adapt the namespaces and rewrite sime BitOperations methods, was very smooth ;)
Glad to hear it was straightforward.
Erik Madsen | My C# chess engine: https://www.madchess.net