Created
May 1, 2019 01:50
-
-
Save deathmarine/0f6c291540e2ca6773373ba855cecd6c to your computer and use it in GitHub Desktop.
Check for win method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public boolean checkForWin(int index) { | |
//TO DO: check to see if there is a winner. If so, set win field and return true; otherwise, return false | |
if(gameArray[0] == gameArray[1] && gameArray[1] == gameArray[2]) | |
win = Win.TOP_ROW; // Could probably do this with a case switch | |
if(gameArray[0] == gameArray[3] && gameArray[3] == gameArray[6]) | |
win = Win.TOP_ROW; // Could probably do this with a case switch | |
//Blah... If statement | |
//More If statements | |
//MOAR if statements | |
return win != Win.NONE; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment