String [] board = new String [9];
String [] sequence = new String [8];
sequence[0] = board[0]+board[1]+board[2];
sequence[1] = board[0]+board[3]+board[6];
sequence[2] = board[0]+board[4]+board[8];
sequence[3] = board[1]+board[4]+board[7];
sequence[4] = board[2]+board[5]+board[8];
sequence[5] = board[2]+board[4]+board[6];
sequence[6] = board[3]+board[4]+board[5];
sequence[7] = board[6]+board[7]+board[8];
Say I was to make sequence[0]="XXO";
How could I take sequence[0]
and change the the board points so that:
board[0]="X";
board[1]="X";
board[2]="O";
I am trying to run this for loop and I have to initialize the board array before the sequences part as I am printing it out to the screen and can't have the values be null.
for(int i = 0; i < 8; i++
{
if(sequence[i].equals("X"+"X"+" "))
{
sequence[i] = "XXO";
}
}