ChessAIbyMrNaniii 1.0.5

dotnet add package ChessAIbyMrNaniii --version 1.0.5
                    
NuGet\Install-Package ChessAIbyMrNaniii -Version 1.0.5
                    
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="ChessAIbyMrNaniii" Version="1.0.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ChessAIbyMrNaniii" Version="1.0.5" />
                    
Directory.Packages.props
<PackageReference Include="ChessAIbyMrNaniii" />
                    
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 ChessAIbyMrNaniii --version 1.0.5
                    
#r "nuget: ChessAIbyMrNaniii, 1.0.5"
                    
#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 ChessAIbyMrNaniii@1.0.5
                    
#: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=ChessAIbyMrNaniii&version=1.0.5
                    
Install as a Cake Addin
#tool nuget:?package=ChessAIbyMrNaniii&version=1.0.5
                    
Install as a Cake Tool

ChessAI

A chess artificial intelligence module built to work seamlessly with the ChessLib engine. It uses the Minimax algorithm with Alpha-Beta pruning to evaluate board positions and calculate the best possible moves.

Installation

Install the library via NuGet (this will automatically include ChessLib as a dependency):

dotnet add package ChessAIbyMrNaniii

Usage

To use the AI, you need an active instance of the GameManager from ChessLib.

Initialization

using ChessLib.Logic;
using ChessLib.Pieces;
using ChessAI;

// 1. Initialize the game engine
GameManager game = new GameManager();

// 2. Initialize the bot
// Parameters: The color the bot plays as, and the search depth (e.g., 3 half-moves)
Bot aiBot = new Bot(PieceColor.Black, 3);

Finding and Making the Best Move

When it is the bot's turn, pass the current game state to the bot to calculate the best move.

// 1. Calculate the best move
var bestMove = aiBot.FindBestMove(game);

// 2. Validate that a move was found (returns 0,0 if checkmated or stalemated)
if (bestMove.from.X != 0 || bestMove.from.Y != 0)
{
    // 3. Apply the move to the engine
    game.MakeMove(bestMove.from, bestMove.to, out _);
    
    Console.WriteLine("The bot has made its move!");
}
else
{
    Console.WriteLine("Game Over. The bot has no legal moves.");
}

Difficulty Levels

You can easily adjust the difficulty of the bot by changing the depth parameter in the constructor. A higher depth results in a stronger opponent but requires more processing time.

  • Depth 1-2: Beginner (Very fast)
  • Depth 3-4: Intermediate (Good balance of speed and skill)
  • Depth 5+: Advanced (Stronger calculation, requires more computation time)
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.

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.0.5 128 5/20/2026
1.0.4 105 5/5/2026
1.0.3 115 5/5/2026
1.0.2 105 4/30/2026
1.0.1 110 4/23/2026
1.0.0 122 4/7/2026