Sudoku 1.0.10

There is a newer version of this package available.
See the version list below for details.
dotnet add package Sudoku --version 1.0.10                
NuGet\Install-Package Sudoku -Version 1.0.10                
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="Sudoku" Version="1.0.10" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Sudoku --version 1.0.10                
#r "nuget: Sudoku, 1.0.10"                
#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 Sudoku as a Cake Addin
#addin nuget:?package=Sudoku&version=1.0.10

// Install Sudoku as a Cake Tool
#tool nuget:?package=Sudoku&version=1.0.10                

Sudoku

A fast implementation of a Sudoku solver in C#.

Usage

var puzzle = new int[81];

/*
  Fill the array with the puzzle here. Use 0 to represent empty cells.
  
  Just flatten the puzzle into one long sequence,
  so puzzle[0..8] is the first row, puzzle[9..17] is second and so on.
*/

var solver = new Solver();

var result = solver.Solve(puzzle);

for (var y = 0; y < 9; y++)
{
    for (var (x = 0; x < 9; x++)
    {
        Console.Write($"{result.Solution[y * 9 + x]} ");
    }
    
    Console.WriteLine();
}

// The result has additional informational properties.

result.Steps; // How many steps were explored to find the answer.

result.Microseconds; // How long it took to solve.

/*
  There is an option to get the order in which the answer was found.
  This isn't generated by default for performance reasons.
  If you would like the history, add true as a parameter to the Solve call...
*/

solver.Solve(puzzle, true);

foreach (var move in result.History)
{
    Console.WriteLine($"Row: {move.Y}    Column: {move.X}    Value: {move.Value}");        
}
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.
  • net8.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.12 226 5/4/2024
1.2.11 125 3/20/2024
1.2.10 103 3/20/2024
1.2.9 112 3/15/2024
1.2.7 125 3/14/2024
1.2.6 113 3/14/2024
1.2.5 131 3/14/2024
1.2.4 121 3/14/2024
1.2.3 128 3/13/2024
1.2.2 131 3/13/2024
1.2.1 130 3/12/2024
1.2.0 124 3/12/2024
1.1.6 136 3/12/2024
1.1.5 123 3/12/2024
1.1.4 113 3/12/2024
1.1.3 116 3/9/2024
1.1.2 131 3/9/2024
1.1.1 130 3/7/2024
1.1.0 130 3/7/2024
1.0.10 119 3/6/2024
1.0.9 112 3/6/2024
1.0.8 132 3/6/2024
1.0.4 131 3/6/2024
1.0.1 123 3/6/2024
1.0.0 104 3/6/2024