pax.chess 0.6.1

.NET 6.0
NuGet\Install-Package pax.chess -Version 0.6.1
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.
dotnet add package pax.chess --version 0.6.1
<PackageReference Include="pax.chess" Version="0.6.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add pax.chess --version 0.6.1
#r "nuget: pax.chess, 0.6.1"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install pax.chess as a Cake Addin
#addin nuget:?package=pax.chess&version=0.6.1

// Install pax.chess as a Cake Tool
#tool nuget:?package=pax.chess&version=0.6.1

Introduction

C# dotnet 6 chess library with pgn/fen import/export and move validation.

Getting started

Prerequisites

dotnet 6

Installation

You can install it with the Package Manager in your IDE or alternatively using the command line:

dotnet add package pax.chess

Usage

Sample Project: pax.BlazorChess

Game game = new Game();
EngineMove move = new EngineMove(new Position(4, 2), new Position(5, 3));
var state = game.Move(move);
var pgn = Pgn.MapPieces(game.State);
string pgn = "1. e4 e5 2. Bc4 Bc5 3. Qh5 Nf6 4. Qxf7#";
Game game = Pgn.MapString(pgn);
Assert.True(game.State.Info.IsCheckMate);

string pgn = "1. e4 d5 2. exd5 e6 3. dxe6 Qe7 4. Nc3 Bxe6 5. b3 Bxb3+";
Game game = Pgn.MapString(pgn);
var state = game.Move(new EngineMove(new Position(0, 1), new Position(1, 2)));
Assert.True(state == MoveState.WouldBeCheck);
string fen = "2r3k1/6pp/p3pp1B/2bn4/2pK3P/3b1PR1/P7/3R4 w - - 2 31";
Game game = new Game(fen);
Assert.True(game.State.Info.IsCheckMate);

string pgn = "1. g4 h5 2. gxh5 Rxh5 3. Nf3 Rh6 4. Bh3 Rg6";
Game game = Pgn.MapString(pgn);
var state = game.Move(new EngineMove(new Position(4, 0), new Position(6, 0)));
Assert.True(state == MoveState.CastleNotAllowed);
Product Versions
.NET net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on pax.chess:

Package Downloads
pax.uciChessEngine

C# dotnet 6 Universal Chess Interface wrapper for interacting with chess engine processes.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.6.1 179 1/23/2022
0.6.0 115 1/20/2022
0.5.5 120 1/16/2022
0.5.4 120 1/13/2022
0.5.3 107 1/9/2022
0.5.2 127 1/6/2022