Exemple #1
0
            public override int GetHashCode()
            {
                int hash = TheArray.GetHashCode();

                if (Mode == EMode.HaveIndices)
                {
                    hash ^= Indices.GetSequenceHashCode();
                }
                return(hash);
            }
Exemple #2
0
 public bool Winner()
 {
     int[,] Temp = new int[4, 4] {
         { 1, 2, 3, 4 }, { 5, 6, 7, 8 },
         { 9, 10, 11, 12 }, { 13, 14, 15, 0 }
     };
     for (int i = 0; i < TheArray.GetLength(0); i++)
     {
         for (int j = 0; j < TheArray.GetLength(1); j++)
         {
             if (TheArray[i, j] != Temp[i, j])
             {
                 return(true);
             }
         }
     }
     return(false);
 }
Exemple #3
0
 public void PrintFilds()
 {
     for (int i = 0; i < TheArray.GetLength(0); i++)
     {
         for (int j = 0; j < TheArray.GetLength(1); j++)
         {
             Console.SetCursorPosition(1 * j + 3 * (1 + j * 3), 3 * (1 + i * 2));
             if (TheArray[i, j] != 0)
             {
                 Console.Write("{0,3}", TheArray[i, j]);
             }
             else
             {
                 Console.Write("{0,3}", " ");
             }
         }
         Console.WriteLine();
     }
     Console.SetCursorPosition(0, 26);
 }
Exemple #4
0
 public void FillArray()
 {
     for (int i = 0; i < TheArray.GetLength(0); i++)
     {
         for (int j = 0; j < TheArray.GetLength(1); j++)
         {
             if (i > 0)
             {
                 TheArray[i, j] = (j + 1) + TheArray[i - 1, TheArray.GetLength(1) - 1];
             }
             else
             {
                 TheArray[i, j] = (j + 1);
             }
         }
         if (i == TheArray.GetLength(0) - 1)
         {
             TheArray[i, TheArray.GetLength(1) - 1] = 0;
         }
     }
 }