Advertisement
Guest User

Possible Matchlock Solution

a guest
Dec 7th, 2014
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. Truple<List<Gem>, bool> <--What our GetGemsInRow/Col method will return(Truple basically allows us to return two objects from a single method)
  2.  
  3. the bool will indicate if the list excluded a gem because it was moving, which should indicate that we need to not execute the rest of the FixBoard() method we are currently in- so just call return;
  4.  
  5. Truple<List<Gem>, bool> trup1 = GetGemsInRow(i, j);
  6. Truple<List<Gem>, bool> trup2 = GetGemsInCol(i, j);
  7.  
  8. if ((trup1.Item1.Count < 2 && trup2.Item1.Count < 2) || (trup1.Item2 && trup2.Item2))
  9. {
  10. return;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement