I worked on it some more. But I still can't figure out how to get the input the player enters to go to the designated space and for that space to be an X.
/*
import java.io.*;
public class H2_tictactoe
{
public static void main(String[] args)throws IOException
{
char board[] = {0,0,0,0,0,0,0,0,0};
int n;
String inputPlayer;
BufferedReader dataIn = new BufferedReader(new InputStreamReader(System.in));
menu();//call method menu
showBoard(board);//call method showBoard and pass board array from main
inputPlayer = dataIn.readLine();
n = Integer.parseInt(inputPlayer);
addMove(n, board);
}
public static void menu()
{
System.out.println("------------");
System.out.println(" 0| 1 | 2 |");
System.out.println("------------");
System.out.println(" 3| 4 | 5 |");
System.out.println("------------");
System.out.println(" 6| 7 | 8 |");
System.out.println("------------");
System.out.println("\t");
System.out.println("Choose the number associated with the space where you want to move:");
System.out.println("0. Space 0");
System.out.println("1. Space 1");
System.out.println("2. Space 2");
System.out.println("3. Space 3");
System.out.println("4. Space 4");
System.out.println("5. Space 5");
System.out.println("6. Space 6");
System.out.println("7. Space 7");
System.out.println("8. Space 8");
System.out.println("\t");
}
public static void showBoard(char theboard[])
{
System.out.println("------------");
System.out.println (theboard[0] + " | " + theboard[1] + " | " + theboard[2]);
System.out.println("------------");
System.out.println (theboard[3] + " | " + theboard[4] + " | " + theboard[5]);
System.out.println("------------");
System.out.println (theboard[6] + " | " + theboard[7] + " | " + theboard[8]);
System.out.println("------------");
}
public static void addMove( int n, char theboard[])
{
}
}