Never ending loop

Why a loop is never ending a you use de function random as in:

for (int i = 0; i < 1000; i = i+1)
               A = random(i);
               B = random(i);

And how can you make it end

the for loop is assigned to choosing a value in the x and y, not to dictating how long the loop runs for. It runs in draw which is an infinite for loop, and therefore it never ends.

If that’s what you wanted you would need a if statement to handle the time constraint.

void setup(){
int j = 0;
void draw(){
  if (j<100){
  for (int i = 0; i < 100; i ++)
float A = random(i);
float B = random(i);

Thank you veru much…

Another way is to call noLoop() in setup. Then draw runs only once, with no loop, so your for loop runs only once, not 60fps.