The printed result should be like this (I don't know how to format it, but imagine a 9x9 2d array where the 1's create an X):
1 0 0 0 0 0 0 0 1
0 1 0 0 0 0 0 1 0
0 0 1 0 0 0 1 0 0
0 0 0 1 0 1 0 0 0
0 0 0 0 1 0 0 0 0
0 0 0 1 0 1 0 0 0
0 0 1 0 0 0 1 0 0
0 1 0 0 0 0 0 1 0
1 0 0 0 0 0 0 0 1
This is what I have so far:
int [][] myArray = new int[9][1];
for (int row = 0 ; row < 9 ; row++)
for (int column = 0 ; column < 1 ; column++)
myArray[row][column]= 0;
How would I create a while loop for this?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…