OK so what would I need to change to the following code so it would produce the following:
xxx
xoo
xoo
As at the moment it is producing:
xxxooo
xxxooo
xxxooo
My code that I have used can be seen below:
import javax.swing.*;
public class test {
public static void main(String[] args){
int row;
String num = JOptionPane.showInputDialog("Input?");
row = Integer.parseInt(num);
for(int i = 0; i < row; i++){
for(int j = 0; j < row; j++){
System.out.print("X");
}
for (int z = 0; z < row; z++){
System.out.print("O");
}
System.out.println("");
}
}
}