Пример #1
0
        internal (int X1, int X2, int X3) getData()
        {
            int count  = 0;
            int count1 = 0;
            int count2 = 0;

            for (int i = 0; i < Size; i++)
            {
                for (int j = 0; j < Size; j++)
                {
                    BooleanBox box = BooleanGame[i, j];
                    if (box.IsComplete)
                    {
                        count++;
                    }
                    else if (box.HasL)
                    {
                        count1++;
                    }
                    else if (box.Lines3)
                    {
                        count2++;
                    }
                }
            }
            return(count, count1, count2);
        }
Пример #2
0
 public static void CreateBoxMatrix(this BooleanState te)
 {
     BooleanBox[,] gmstate = new BooleanBox[te.Size, te.Size];
     for (int i = 0; i < te.Size; i++)
     {
         for (int j = 0; j < te.Size; j++)
         {
             bool up    = te.BoolRow[i, j];
             bool down  = te.BoolRow[i + 1, j];
             bool left  = te.BoolColumn[j, i];
             bool right = te.BoolColumn[j + 1, i];
             gmstate[i, j] = new BooleanBox {
                 Up = up, Left = left, Right = right, Down = down
             };
         }
     }
     te.BooleanGame = gmstate;
 }