Can someone explain to me what this is?
I have been asked to code a tic-tac-toe board using an array which I have done, but the brief specifies using standard input, and I have no idea what that is, but I'm guessing does not include changing the values of the array manually in the code view!
import javax.swing.JOptionPane;
class nx {
public static void main(String[] args) {
int[][] area; // declares array of integers
final int O = 1; //denotes a nought
final int X = 2; //denotes a cross
area = new int[3][3]; // allocates memory for 9 integers
area[0][0] = O; // places first figure
area[0][1] = O; // places second figure
area[0][2] = X; // etc.
area[1][0] = X;
area[1][1] = O;
area[1][2] = X;
area[2][0] = O;
area[2][1] = X;
area[2][2] = O;
//read each line individually, printing 'true' if noughts (1) have won, 'false' if crosses (2) have won, or nothing otherwise
if (area[0][0] == 1 && area [0][1] == 1 && area [0][2] == 1){
System.out.println("true");}
else if (area[0][0] == 2 && area [0][1] == 2 && area [0][2] == 2){
System.out.println("false");}
if (area[1][0] == 1 && area [1][1] == 1 && area [1][2] == 1){
System.out.println("true");}
else if (area[1][0] == 2 && area [1][1] == 2 && area [1][2] == 2){
System.out.println("false");}
if (area[2][0] == 1 && area [2][1] == 1 && area [2][2] == 1){
System.out.println("true");}
else if (area[2][0] == 2 && area [2][1] == 2 && area [2][2] == 2){
System.out.println("false");}
if (area[0][0] == 1 && area [1][0] == 1 && area [2][0] == 1){
System.out.println("true");}
else if (area[0][0] == 2 && area [1][0] == 2 && area [2][0] == 2){
System.out.println("false");}
if (area[0][1] == 1 && area [1][1] == 1 && area [2][1] == 1){
System.out.println("true");}
else if (area[0][1] == 2 && area [1][1] == 2 && area [2][1] == 2){
System.out.println("false");}
if (area[0][2] == 1 && area [1][2] == 1 && area [2][2] == 1){
System.out.println("true");}
else if (area[0][2] == 2 && area [1][2] == 2 && area [2][2] == 2){
System.out.println("false");}
if (area[0][0] == 1 && area [1][1] == 1 && area [2][2] == 1){
System.out.println("true");}
else if (area[0][0] == 2 && area [1][1] == 2 && area [2][2] == 2){
System.out.println("false");}
if (area[0][2] == 1 && area [1][1] == 1 && area [2][0] == 1){
System.out.println("true");}
else if (area[0][2] == 2 && area [1][1] == 2 && area [2][0] == 2){
System.out.println("false");}
}
}
That is the code I have at the moment, but what I want to do is use standard input to enter the values into the array, rather than typing them in myself
Can anyone assist?