{
for (short i = 0; i <9; i++)
{
for (short j = 0; j <9; j++)
{
field [i, j].Standard = false;
field [i, j].Repeat = false;
}
}
time = 0;
Random rand = new Random ();
numbers = new short [9] {1, 2, 3, 4, 5, 6, 7, 8, 9};
// Рандомное формирование первой стороки
for (short i = 0; i <9; i++)
{
short tempRand = (short)(rand.Next (45689) % (9 – i));
field [0, i].Value = numbers [tempRand];
for (short j = tempRand; j <9 – i – 1; j++)
{
numbers [j] = numbers [j +1];
}
}
// Формирование строк согласно перестановкам
numbers = new short [9] {8, 3, 4, 6, 7, 0, 5, 1, 2};
// Формирование второй строки
for (short i = 0; i <9; i++)
{
field [1, numbers[i]].Value = field [0, i].Value;
}
numbers = new short [9] {5, 6, 8, 2, 0, 7, 1, 3, 4};
// Формирование третьей строки
for (short i = 0; i <9; i++)
{
field [2, numbers[i]].Value = field [0, i].Value;
}
numbers = new short [9] {2, 8, 6, 4, 3, 1, 7, 0, 5};
// Формирование четвертой строки
for (short i = 0; i <9; i++)
{
field [3, numbers[i]].Value = field [0, i].Value;
}
numbers = new short [9] {7, 5, 3, 1, 2, 6, 4, 8, 0};
// Формирование пятой строки
for (short i = 0; i <9; i++)
{
field [4, numbers[i]].Value = field [0, i].Value;
}
numbers = new short [9] {4, 2, 1, 7, 8, 3, 0, 5, 6};
// Формирование шестой строки
for (short i = 0; i <9; i++)