pax.chess 0.6.2

dotnet add package pax.chess --version 0.6.2                
NuGet\Install-Package pax.chess -Version 0.6.2                
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="pax.chess" Version="0.6.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add pax.chess --version 0.6.2                
#r "nuget: pax.chess, 0.6.2"                
#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.
// Install pax.chess as a Cake Addin
#addin nuget:?package=pax.chess&version=0.6.2

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

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 Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
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.2 2,023 12/18/2023
0.6.1 1,291 1/23/2022
0.6.0 793 1/20/2022
0.5.5 790 1/16/2022
0.5.4 785 1/13/2022
0.5.3 281 1/9/2022
0.5.2 781 1/6/2022