The code below works, but index.add(j, i) does not update when highest does? I need to know which ones in the array were selected to be the highest. I have also tried using a variable and using (array.add(index)), near array.add(highest); is, but it always says 0. array does contain the correct highest values, so highest = array.get(i); must work?
Also print statements do not work near highest = array.get(i);?
for (int j =0; j<7; j++) { index.add(j, 0); int highest = array.get(j*7+1); for (int i = 2+(j*7); i<7+(j*7)+1;i = i+7+1) { if highest<array.get(i)) { index.add(j, i); highest = array.get(i); } } array.add(highest); }
Thanks