This is bothering me, my code works and runs but when I went to run it, it seems to be looping my for loops twice, can anyone help me with my logic? Thanks...
for(int i = 0; i < radius.length; i++) { for (int j = 0; j < radius.length; j++) {
Most loops where you wish to compare every pairing of two elements together is instead written like this:
for(int i = 0; i < radius.length; i++) { for (int j = i; j < radius.length; j++) {
(Note the j = i in the second loop.)
This also lets you remove the i != j test. :)
EDIT: Oops; j = i means you still need to i != j test -- if you used j = i+1 then you can remove the i != j test. Sigh. :)