EDIT EDIT EDIT Okay, I've boiled down the for loop, but now I've got a problem with the cell assignment it seems.
int itemsX = (int) n*n*(percentX/100);
int itemsBlank = (int) n*n*(percentBlank/100);
int itemsO = (n*n) - (itemsBlank + itemsX);
// Now we construct the grid.
for (i = 0; i < n; i++) {
for ( j = 0; j< n; j++) {
double q = Math.random();
// In this first set of If/Else's, the program will
// use a random number generator to place our items.
if (q >= .66 && a < itemsBlank) {
tissue[i][j] = ' ';
a = a + 1;
// In the event the Program has used up all of one particular item in a grid before finishing,
//it will redirect the randomized value to a different item to be put in place.
}if (q >= .66 && a == itemsBlank){
q = q - .33; }
if (q < .66 && q >= .33 && b < itemsO) {
tissue[i][j] = 'O';
b = b + 1;
if (q <.66 && q >= .33 && b == itemsO)
{ q = q - .33;
}if (q < .33 && c < itemsX) {
tissue[i][j] = 'X';
c = c + 1;
}if (q < .33 && c == itemsX)
{q = q + .66;
}
if(q >= .66 && a < itemsBlank) {
tissue[i][j] = ' ';
a = a + 1;
}
System.out.print(tissue[i][j]);
}
}System.out.println();
}
}
Also, I deleted the excess text because I imagine the wall of text was unbearable to look at.
EDIT EDIT Scratch that, I think I understand what might be the problem. I won't be able to use the simple way to print the array as I'm barred from using the java.util.scanner library, so I'll have to print it manually. So I think my problem is I'll need to simply work out designing a double for loop for this. I'll see if I can do it myself, but any additional input would be greatly appreciated.
EDIT: Special thanks to rgettman for helping me understand how to print the array.