# For Statement not working

**URL:** <https://discourse.processing.org/t/for-statement-not-working/18257>\
**Category:** Beginners\
**Created:** [February 29, 2020, 9:56pm UTC](https://discourse.processing.org/t/for-statement-not-working/18257 "2020-02-29T21:56:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![GKBeginner](https://avatars.discourse-cdn.com/v4/letter/g/5fc32e/32.png) [@GKBeginner](https://discourse.processing.org/u/GKBeginner)\
**Post date:** [February 29, 2020, 9:56pm UTC](https://discourse.processing.org/t/for-statement-not-working/18257/1 "2020-02-29T21:56:56Z")

</div>

I can’t seem to limit this to 25 ellipses even though I wrote a for statement.

```auto
float randomX;
float randomY;
float randomZ;
float randomQ;
int x;

void setup(){
  size(400,400);
  background(250,250,0);
   
}

void draw() {
randomX = random(width);
randomY = random(height);
randomZ = random(10,50);
randomQ = random(10,50);

    for(randomX=random(width); randomX<25; randomX++);

  fill(random(0,256), random(0,256), random(0,256));
  ellipse(randomX, randomY, randomZ, randomQ);
}

```

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [March 1, 2020, 12:36am UTC](https://discourse.processing.org/t/for-statement-not-working/18257/3 "2020-03-01T00:36:10Z")

</div>

Hello,

You have already highlighted the line that is the problem.

Some resources:

> **[for / Reference](https://processing.org/reference/for.html)**
>
> Controls a sequence of repetitions. A basic for structure has three parts: init, test, and update. Each part must be separated by a semicolon (;). The loop continues until …

[![](https://img.youtube.com/vi/cnRD9o6odjk/maxresdefault.jpg "4.1: while and for Loops - p5.js tutorial") ](https://www.youtube.com/watch?v=cnRD9o6odjk)

`:)`
