Random StrokeWeight not working?

Hey everyone, I’m making a program that will output balloons of different sizes using for loops. The fill should also be using stroke (another for loop). The program outputs balloons of the same size (code is below)… Help?

void setup()
{
  size(800,500);
  for (int i = 0;i<=800;i+=150){
  for (int random = 0; random<=100;random+=20)
      strokeWeight(random);
      point(i,100);
      strokeWeight(3);
      line(i,100,i,400);
  }
}
1 Like

That will not produce a random result, as it will end up with the same result each time. You should use the random(); function instead.

https://processing.org/reference/random_.html

2 Likes

Thanks for the help! Works like a charm :+1: