Created
February 26, 2014 02:13
-
-
Save anonymous/9222132 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| for(int line = 0; line <= 2; line++) | |
| { | |
| if ((board[x][y] == board[x + 1][y + 1] && board[x][y] == board[x + 2][y + 2]) || // check forward diagonal | |
| (board[x][y + 2]==board[x + 1][y + 1] && board[x][y + 2] == board[x + 2][y]) || // check backward diagonal | |
| (board[x + line][y] == board[x + line][y + 1] && board[x + line][y] == board[x + line][y + 2]) || // check rows | |
| (board[x][y + line] ==board[x + 1][y + line] && board[x][y + line] == board[x + 2][y + line])) // check columns | |
| { | |
| if (board[x][y] != '-') | |
| { | |
| puts("HERE"); | |
| return 2; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment