Skip to content
This repository has been archived by the owner on Aug 28, 2022. It is now read-only.
/ Stockfish.NET Public archive

Interloop with Stockfish chess engine in c# language on .net platform

License

Notifications You must be signed in to change notification settings

Oremiro/Stockfish.NET

Repository files navigation

Stockfish.NET

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

<PackageReference Include="Stockfish.NET" Version="1.0.7" />

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:

d2d4

Get evaluation

Input:

var bestMove = stockfish.GetEvaluation();

Output:

cp

License

MIT License. Please see License file (LICENSE) for more information.

About

Interloop with Stockfish chess engine in c# language on .net platform

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages