UCI Library to assist with the UCI parsing n stuff...
Lets have an example project named CE because im lazy.
-
Clone this repo or add this repo as submodule to an existing repo.
[CE]$ git submodule add https://github.com/Fraction-ChessEngine/Fraction.UCI deps/Fraction.UCI
-
Add Fraction.UCI.csproj as project reference
[CE]$ dotnet add reference deps/Fraction.UCI/Fraction.UCI/
-
Create a
staticclass that will later be our engine similar to this:using Fraction.UCI; class CE : Engine { public CE() : base() {} protected override void handle(ICommand command) { throw new NotImplementedException(); } }
-
Implement the handle() function. This function will be called every time the engine receives a command. I recommend something like the following:
switch (command) { ... case Unknown: this.Log(LogLevel.Warning, $"Received unknown command '{command.Serialize()}'"); break; default: this.Log(LogLevel.Warning, $"Not handling command '{command.Serialize()}'"); break; }
-
Add boilerplate in Program.cs:
var ce = new CE(); ce.run();
-
Enjoy! See the Wiki for more information on Custom commands and uci in general. If you have questions or ideas, feel free to open up issues.
- Unit Testing
- UCI commands
- uci
- debug
- isready
- setoption
- register
- ucinewgame
- position
- go
- stop
- ponderhit
- quit
- id
- uciok
- readyok
- bestmove
- copyprotection
- registration
- info partially
- option
- GUI Side code
- Comprehensive Wiki
- Custom commands
- more detail about this lib
- UCI
- Nuget package