Advertisement
eduardamsc

lpoo

Mar 4th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.91 KB | None | 0 0
  1. public boolean isHorizontalMatch(int x, int y, String texture){
  2.         if (x == 0) {
  3.             System.out.println("x= "+x);
  4.             return (texture == gems[x+1][y].l && texture == gems[x+2][y].l);
  5.         }
  6.         else if (x == 7) return (texture == gems[x-1][y].l && texture == gems[x-2][y].l);
  7.         else if (x == 1) {
  8.             System.out.println("x= "+x);
  9.             return ((texture == gems[x+1][y].l && texture == gems[x+2][y].l) || (texture == gems[x-1][y].l && texture == gems[x+1][y].l));
  10.         }
  11.         else if (x == 6) return ((texture == gems[x-1][y].l && texture == gems[x-2][y].l) || (texture == gems[x-1][y].l && texture == gems[x+1][y].l));
  12.         else return ((texture == gems[x+1][y].l && texture == gems[x+2][y].l)
  13.                     || (texture == gems[x-1][y].l && texture == gems[x+1][y].l)
  14.                     || (texture == gems[x-1][y].l && texture == gems[x-2][y].l));
  15.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement