Advertisement
Guest User

Untitled

a guest
Jun 20th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.78 KB | None | 0 0
  1.         public void checkIfLegal(){
  2.                 if (square[2][0] == 19 || square[3][0] == 19) {
  3.                     foreach (List<int> sq in square) {
  4.                         GameBoard.notLegal.Add(Tuple.Create(sq[0], sq[1]));
  5.                     }
  6.  
  7.                 if (GameBoard.notLegal.Any()){
  8.                 foreach (Tuple<int, int> pos in GameBoard.notLegal) {
  9.                         if ((square [2] [0] == pos.Item1 && square[2][1] == pos.Item2) || (square [3] [0] == pos.Item1) && square[3][1] == pos.Item2) {
  10.                             temp.Add (Tuple.Create (square [0] [0], square [0] [1]));
  11.                             temp.Add (Tuple.Create (square [1] [0], square [1] [1]));
  12.                             temp.Add (Tuple.Create (square [2] [0], square [2] [1]));
  13.                             temp.Add (Tuple.Create (square [3] [0], square [3] [1]));
  14.  
  15.                         }
  16.                     }
  17.                 }
  18.                 GameBoard.notLegal.Union (temp);
  19.                 temp.Clear ();
  20.                 Reset();
  21.             }
  22.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement