Guest User

Untitled

a guest
May 26th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.22 KB | None | 0 0
  1. do
  2.             {
  3.                 noSwap = 0;
  4.                 for (row = 0; row < 7; row++)
  5.                 {
  6.                     for (col = 0; col < 7; col++)
  7.                     {
  8.                         // A B C D
  9.                         //[X]X X X
  10.                         // E F G H
  11.                         if (CheckThree(row, col, 0, 1))     //If 3 are lined up, see if more are lined up
  12.                         {
  13.                             changeMade = true;
  14.                             if (CheckFour(row, col, 0, 1))  //Check to see if 4 are lined up
  15.                                 CheckFive(row, col, 0, 1);  //Check to see if 5 are lined up  
  16.                         }
  17.                         else    //If 3 aren't lined up, then no switch is made
  18.                             noSwap++;
  19.                         //A B C D
  20.                         //X X X[X]
  21.                         //E F G H
  22.                         if (CheckThree(row, col, 0, -1))
  23.                         {
  24.                             changeMade = true;
  25.                             if (CheckFour(row, col, 0, -1))
  26.                                 CheckFive(row, col, 0, -1);
  27.                         }
  28.                         else noSwap++;
  29.                         //[X]B C D
  30.                         ///X A I J
  31.                         ///X F G H
  32.                         if (CheckThree(row, col, 1, 0))
  33.                         {
  34.                             changeMade = true;
  35.                             if (CheckFour(row, col, 1, 0))
  36.                                 CheckFive(row, col, 1, 0);
  37.                         }
  38.                         else
  39.                             noSwap++;
  40.                         ///X B C D
  41.                         ///X A I J
  42.                         //[X]F G H
  43.                         if (CheckThree(row, col, -1, 0))
  44.                         {
  45.                             changeMade = true;
  46.                             if (CheckFour(row, col, -1, 0))
  47.                                 CheckFive(row, col, -1, 0);
  48.                         }
  49.                         else
  50.                             noSwap++;
  51.                     }
  52.                 }
  53.             } while (noSwap != 4);    //End loop if 0 changes have been made
Add Comment
Please, Sign In to add comment