}
// Освобождение клеток на поле
public void DeleteNumbersFromField ()
{
Random rand = new Random ();
for (short k = 0; k <9; k++)
{
short [] randString = new short [9];
numbers = new short [9] {0, 1, 2, 3, 4, 5, 6, 7, 8};
for (short i = 0; i <9; i++)
{
short temp = (short)(rand.Next (45689 * (i +1) – 6) % (9 – i));
randString [i] = numbers [temp];
for (short j = temp; j <9 – i – 1; j++)
{
numbers [j] = numbers [j +1];
}
}
short tempRand = (short)(rand.Next (4, 7));
for (short t = 0; t <tempRand; t++)
{
field [k, randString[t]].Value = 0;
}
for (short t = tempRand; t <9; t++)
{
field [k, randString[t]].Standard = true;
}
}
}
// Проверка условий победы
public bool Win ()
{
bool flag = true;
short full = 0;
SearchRepeats ();
// Подсчет заполненных клеток
for (short i = 0; i <9; i++)
{
for (short j = 0; j <9; j++)
{
if (field [i, j].Value!= 0)
{
full++;
}
}
}
// Если заполненны все клетки
if (full == 81)
{
for (short i = 0; i <9; i++)