I have s a 2-dimensional array with lots of rows and columns, with random numbers between 0 and 255. I'm trying to look for instances of particular integers within my array, i.e. those between 231 and 255, and simply print out a String, i.e. "/", "." or a space, each time it comes across such integers. I suppose the following code only works for columns. How might I extend this into rows?
int[][] result = function(parameter);
System.out.println(Arrays.deepToString(result));
for (int i = 1; i <= result.length-1; i++) {
if (result[i][i] >= 179 && result[i][i] <= 204) {
System.out.print("\\");
}
if (result[i][i] >= 205 && result[i][i] <= 230) {
System.out.print(".");
}
if (result[i][i] >= 231 && result[i][i] <= 255) {
System.out.print(" ");
}
}
ndimensional array, you need to havennested loops.