Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- do
- {
- noSwap = 0;
- for (row = 0; row < 7; row++)
- {
- for (col = 0; col < 7; col++)
- {
- // A B C D
- //[X]X X X
- // E F G H
- if (CheckThree(row, col, 0, 1)) //If 3 are lined up, see if more are lined up
- {
- changeMade = true;
- if (CheckFour(row, col, 0, 1)) //Check to see if 4 are lined up
- CheckFive(row, col, 0, 1); //Check to see if 5 are lined up
- }
- else //If 3 aren't lined up, then no switch is made
- noSwap++;
- //A B C D
- //X X X[X]
- //E F G H
- if (CheckThree(row, col, 0, -1))
- {
- changeMade = true;
- if (CheckFour(row, col, 0, -1))
- CheckFive(row, col, 0, -1);
- }
- else noSwap++;
- //[X]B C D
- ///X A I J
- ///X F G H
- if (CheckThree(row, col, 1, 0))
- {
- changeMade = true;
- if (CheckFour(row, col, 1, 0))
- CheckFive(row, col, 1, 0);
- }
- else
- noSwap++;
- ///X B C D
- ///X A I J
- //[X]F G H
- if (CheckThree(row, col, -1, 0))
- {
- changeMade = true;
- if (CheckFour(row, col, -1, 0))
- CheckFive(row, col, -1, 0);
- }
- else
- noSwap++;
- }
- }
- } while (noSwap != 4); //End loop if 0 changes have been made
Add Comment
Please, Sign In to add comment