title: Tic-Tac-Toe in Java
body: <p>I'm having a hard time figuring out how to print out who the winner is. Should I just create a separate method to decide whether someone won or a draw occurred? Here's the code I have so far. Any help is greatly appreciated. </p>
  
  <pre><code>public static void main(String[] args) {
      Scanner in = new Scanner(System.in);
      String[][] board = {
          {" ", " ", " "},
          {" ", " ", " "},
          {" ", " ", " "}
      };
      boolean done = false;
      int player = 1;
      int row = 0;
      int col = 0;
      while (done != true) {
          System.out.println("Enter the row and column for your next move");
          row = in.nextInt();
          col = in.nextInt();
          if (player == 1) {
              board[row][col] = "X";
              player = 2;
          } else {
              board[row][col] = "O";
              player = 1;
          }
          printBoard(board);
  
      }
  
  }
  
  public static void printBoard(String[][] boardValues) {
      for (int row = 0; row &lt; 3; row++) {
          for (int col = 0; col &lt; 3; col++) {
              System.out.print("|" + boardValues[row][col] + "|");
          }
          System.out.println();
          System.out.println("-------");
      }
  }
  </code></pre>