Advertisement
eldieck

Untitled

Feb 4th, 2015
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.23 KB | None | 0 0
  1. private void saveMove(String symbol, int[] move) {
  2.  
  3.         board[move[FIRST]][move[SECOND]] = symbol;
  4.  
  5.         // Checks to see if the user won
  6.         if ((board[FIRST][FIRST].equals("[X]")
  7.                 && board[FIRST][SECOND].equals("[X]") && board[FIRST][THIRD]
  8.                     .equals("[X]"))
  9.                 || (board[SECOND][FIRST].equals("[X]")
  10.                         && board[SECOND][SECOND].equals("[X]") && board[SECOND][THIRD]
  11.                             .equals("[X]"))
  12.                 || (board[THIRD][FIRST].equals("[X]")
  13.                         && board[THIRD][SECOND].equals("[X]") && board[THIRD][THIRD]
  14.                             .equals("[X]"))
  15.                 || (board[FIRST][FIRST].equals("[X]")
  16.                         && board[SECOND][FIRST].equals("[X]") && board[THIRD][FIRST]
  17.                             .equals("[X]"))
  18.                 || (board[FIRST][SECOND].equals("[X]")
  19.                         && board[SECOND][SECOND].equals("[X]") && board[THIRD][SECOND]
  20.                             .equals("[X]"))
  21.                 || (board[FIRST][THIRD].equals("[X]")
  22.                         && board[SECOND][THIRD].equals("[X]")
  23.                         && board[THIRD][THIRD].equals("[X]")
  24.                         || (board[FIRST][FIRST].equals("[X]")
  25.                                 && board[SECOND][SECOND].equals("[X]") && board[THIRD][THIRD]
  26.                                     .equals("[X]")) || (board[FIRST][THIRD]
  27.                         .equals("[X]") && board[SECOND][SECOND].equals("[X]") && board[THIRD][FIRST]
  28.                             .equals("[X]")))) {
  29.             person.setWinnerToTrue();
  30.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement