ChessRealms.Engine 1.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package ChessRealms.Engine --version 1.1.0
                    
NuGet\Install-Package ChessRealms.Engine -Version 1.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ChessRealms.Engine" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ChessRealms.Engine" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="ChessRealms.Engine" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ChessRealms.Engine --version 1.1.0
                    
#r "nuget: ChessRealms.Engine, 1.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ChessRealms.Engine@1.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ChessRealms.Engine&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=ChessRealms.Engine&version=1.1.0
                    
Install as a Cake Tool

ChessRealms.Engine

ChessRealms.Engine is a .NET 10 library for standard chess positions and legal play. It uses bitboards and magic attack tables for move generation. The public ChessGame API supports FEN import/export, legal moves, promotion, history and undo, JSON game records, and standard checkmate, stalemate and supported draw rules. The repository also includes tests, a console game, a perft runner, benchmarks and a magic-number search tool.

It does not provide an AI/search engine, UCI, SAN/PGN, Chess960 or tournament services such as clocks and draw agreements. Dead-position recognition is deliberately incomplete; see the game API guide for the exact boundary.

Build and test

Install the .NET SDK version pinned in global.json and run from the repository root:

dotnet restore ChessRealms.Engine.slnx --locked-mode
dotnet build ChessRealms.Engine.slnx -c Release --no-restore
dotnet test ChessRealms.Engine.slnx -c Release --no-build --filter "TestCategory!=Deep"
dotnet pack src/ChessRealms.Engine/ChessRealms.Engine.csproj -c Release --no-build

The Deep test category contains slower perft cases and is opt-in. See the contribution guide for contributor checks.

See the performance measurements for game API allocation benchmarks, reproduction commands and ownership guarantees.

Public API

using System;
using ChessRealms.Engine;

var game = new ChessGame();
var branch = game.Clone();
var result = branch.MakeMove(CoordinateMove.Parse("e2e4"));

if (result != MoveResult.None)
{
    Console.WriteLine(branch.ToFen());
    ChessPiece piece = branch.GetPiece(Square.Parse("e4"));
    branch.UndoMove();
}

ChessGame is mutable: use Clone() for an independent branch. Coordinate promotions require a suffix such as a7a8q. The game API guide describes ownership, FEN validation, draw claims, repetition and supported rule boundaries.

Save and restore the current move line, including a successful draw claim:

string json = GameRecord.Serialize(game.ExportRecord());
GameRecord record = GameRecord.Deserialize(json);
ChessGame restored = ChessGame.FromRecord(record);

JSON records include a schema version, initial FEN, coordinate moves and an optional draw claim. Import validates the game by replaying its moves. The restored game preserves history, repetition counts and undo support.

The package intentionally exposes only the high-level types in the ChessRealms.Engine namespace. Bitboards, encoded moves, magic tables, raw positions and repository tools are implementation details and may change without becoming package contracts.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.0 88 10/22/2026
1.1.0 83 10/19/2026
1.0.0 105 9/24/2026