GitHub - jbondarev/Stockfish.NET: Interloop with Stockfish chess engine in c# language on .net platform (original) (raw)
Interloop with Stockfish chess engine in c# language on .net platform
OS supported:
- Windows
- Linux
- MacOS
Install
Package Manager:
PM> Install-Package Stockfish.NET -Version 1.0.7
.NET CLI:
dotnet add package Stockfish.NET --version 1.0.7
Package reference
Usage examples
Create stockfish class
You shold download stockfish engine in your OS. Current version, which tested and used (Stockfish 12)
static void Main(string[] args) { IStockfish stockfish = new Stockfish.NET.Stockfish(@"path\to\stockfish\file"); }
Set position
Input:
stockfish.SetPosition("e2e4", "e7e6");
Get best move
Input:
var bestMove = stockfish.GetBestMove();
Output:
Get evaluation
Input:
var bestMove = stockfish.GetEvaluation();
Output:
License
MIT License. Please see License file (LICENSE) for more information.