Skip to content

Instantly share code, notes, and snippets.

@housemeow
Created October 18, 2013 13:16
Show Gist options
  • Select an option

  • Save housemeow/7041387 to your computer and use it in GitHub Desktop.

Select an option

Save housemeow/7041387 to your computer and use it in GitHub Desktop.
private boolean isWin() {
if (topLeft == left && left == bottomLeft && bottomLeft == nowUser) {
return true;
} else if (top == center && center == bottom && bottom == nowUser) {
return true;
} else if (topRight == right && right == bottomRight
&& bottomRight == nowUser) {
return true;
} else if (topLeft == top && top == topRight && topRight == nowUser) {
return true;
} else if (left == center && center == right && right == nowUser) {
return true;
} else if (bottomLeft == bottom && bottom == bottomRight
&& bottomRight == nowUser) {
return true;
} else if (topLeft == center && center == bottomRight
&& bottomRight == nowUser) {
return true;
} else if (bottomLeft == center && center == topRight
&& topRight == nowUser) {
return true;
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment