REALLY basic functions problem

" Remark 1

why did you comment this out:
//MIN = getArrayMin();"

Just to make the circle white®. I’ll uncomment it after I’m happy with my if/else statement but at the moment it’s not working for me.

"Remark 2

That’s a duplicate: textSize(width/4);"

So it is! thanks!

So what I have now is this…

int a[]= new int [50];
int MIN= 59;

void setup()
{
  size(450, 450);

  for (int i=0; i < a.length; i++)
  {
    a[i] = (int) random (255);
    print(a[i]+" , ");
//    println("MIN+", MIN);
  }
  
//MIN = getArrayMin();

}


void draw() {
  fill (MIN);
  ellipse(width/2, height/2, width/2, height/2);
  
  if (MIN<60){
  fill(255);
} else{
  fill(0);
}

  textSize(width/4);
  text(MIN, width*.28, height*.58);

}

int getArrayMin() {
    int MIN_local=11000; 
  for (int i=0; i<a.length; i++)
  {
    if (a[i]< MIN_local) {
      MIN_local= a[i] ;
    }
  }
  return MIN_local;
}

Seems to be working! Thanks again Chrisir you have honestly made such a big difference to my day. I couldn’t be more grateful.

1 Like