static readonly int[,] EASY_GRID = {
{5,3,0, 0,7,0, 0,0,0},
{6,0,0, 1,9,5, 0,0,0},
{0,9,8, 0,0,0, 0,6,0},
{8,0,0, 0,6,0, 0,0,3},
{4,0,0, 8,0,3, 0,0,1},
{7,0,0, 0,2,0, 0,0,6},
{0,6,0, 0,0,0, 2,8,0},
{0,0,0, 4,1,9, 0,0,5},
{0,0,0, 0,8,0, 0,7,9},
};
static readonly int[,] MEDIUM_GRID = {
{0,0,0, 2,6,0, 7,0,1},
{6,8,0, 0,7,0, 0,9,0},
{1,9,0, 0,0,4, 5,0,0},
{8,2,0, 1,0,0, 0,4,0},
{0,0,4, 6,0,2, 9,0,0},
{0,5,0, 0,0,3, 0,2,8},
{0,0,9, 3,0,0, 0,7,4},
{0,4,0, 0,5,0, 0,3,6},
{7,0,3, 0,1,8, 0,0,0},
};
static readonly int[,] HARD_GRID = {
{0,0,0, 6,0,0, 4,0,0},
{7,0,0, 0,0,3, 6,0,0},
{0,0,0, 0,9,1, 0,8,0},
{0,0,0, 0,0,0, 0,0,0},
{0,5,0, 1,8,0, 0,0,3},
{0,0,0, 3,0,6, 0,4,5},
{0,4,0, 2,0,0, 0,6,0},
{9,0,3, 0,0,0, 0,0,0},
{0,2,0, 0,0,0, 1,0,0},
};
static readonly Dictionary<string,int[,]> GRIDS = new()
{
{"Easy", EASY_GRID}, {"Medium", MEDIUM_GRID}, {"Hard", HARD_GRID}
};
// Copie profonde d'une grille (les solveurs muent la grille en place).
static int[,] CopyGrid(int[,] src)
{
var dst = new int[9,9];
for (int r=0;r<9;r++) for (int c=0;c<9;c++) dst[r,c]=src[r,c];
return dst;
}
foreach (var (name, grid) in GRIDS)
{
int givens = 0;
for (int r=0;r<9;r++) for (int c=0;c<9;c++) if (grid[r,c]!=0) givens++;
Console.WriteLine($"{name,-6} : {givens,2} indices donnes, {81-givens,2} cases vides");
}