title: Player vs. computer tic tac toe game code
body: <p>I've been recently assigned a project from my AP Java class and ran into some difficulty. The whole objective of the project is to create a one player vs computer tic tac toe game. I have found success in creating a game board object and entering certain chars in the array. However i'm quite stuck and have no idea what to do with the following aspects of the game:</p>
  
  <p>-Allowing the computer to make a move after the player has
  -Allowing the user to enter two numbers that will allow them to make a move instead of hardcoding it (i've been using random values just to test around)
  -Evaluating a win or tie condition.</p>
  
  <p>Thanks so much! I've really been frustrated with this code lately and any advice will help!!</p>
  
  <ul>
  <li>Board Class Code:</li>
  </ul>
  
  <p><code>public class TicTacToeBoard{
  private char[][] ttBoard;//initializes the type of array for the board
  private boolean gameActive = true;</code></p>
  
  <pre><code>public TicTacToeBoard(){ //Constructs our board as an object
  
  ttBoard = new char[3][3]; //initialize the 2D array
  
  for(int i = 0; i &lt; ttBoard.length ; i++){
    Arrays.fill(ttBoard[i], ' '); 
  }
  }
  
  
  public void printBoard(){ //we print our board object using this method
  for(int i = 0; i&lt;ttBoard.length; i++){
    for(int j = 0; j&lt;ttBoard[i].length; j++){
      System.out.print(ttBoard[i][j]);
      if(j==0 || j==1)   //this loop helps separate indices, makes it look like a real board.
        System.out.print("|"); 
    }
    if(i==0||i==1)
    System.out.print("\n-----\n");
  }
  System.out.println();
  }
  
  
    public boolean makeMove(char player , int i, int j)//here it prompts the player for a move 
  //and also uses boolean to make the move
    {
     if(i &gt;= 0 &amp;&amp; i&lt;= 2 &amp;&amp; j &gt;= 0 &amp;&amp; j&lt;= 2)
     {
        if(ttBoard[i][j] != ' ')
      return false;
     else
     {
      ttBoard[i][j] = player;
      return true;
     }
    } 
  else
    return false;
  }
  
  
  public boolean gameOn()//this method will determine whether the game continues
  {
   return gameActive
  }
  
  public void askPlayer(char player) //prompts users turn
  {
  
  }
  
  public void askComp()  //prompts computers turn
  {
  }
  
  
  }
  </code></pre>
  
  <p>Main Class code:</p>
  
  <pre><code>public class TicTacToe{
  
  public static void main(String[] args){
    TicTacToeBoard game = new TicTacToeBoard();
    game.printBoard();
    int count = 1;
  
  while(game.gameOn())
  {
    if (count%2 == 0)
      game.askPlayer('X');
    else
      game.askComp('O');
    count++;
  }
  game.printBoard();
  }
  }
  </code></pre>