need help creating my Tic Tac Toe game!
This is what i have so far for creating a simple tic tac toe game (user vs computer).
Im not sure how to determine the winner propely by using an if '3 x's or o's are in a row then that person/computer wins.
// The "TicTacToe" class.
public class TicTacToe
static Console c; // The output console
public static void main (String args)
c = new Console ();
// Place your program here. 'c' is the output console
board = new String ;
int playerMove = 0;
c.print ("Tic Tac Toe Game!");
//prompt user for their move
c.print ("Enter the location of your next move (0-8): ");
playerMove = c.readInt ();
board [playerMove] = "X";
//the computer must now make a move choosing a random number 0-8 and printing an "O"
for (int counter = 0 ; counter < 1 ; counter++)
compMove = (int) (Math.random () * (8 - 0 + 1)) + 0;
board [compMove] = "O";
//make an if statement to determine if there is a winner
if (board[playerMove]= "XXX") //if player gets three X's in a row
c.println ("Player Wins!");
else if (board[compMove]= "OOO") //if player gets three O's in a row
c.println ("Computer Wins!");
//make a loop so the game goes on until the maximum moves (9) have occured
while (board[playerMove]+ [compMove]<9)
} // main method
} // TicTacToe class