# Getting message that y is not defined

**URL:** <https://discourse.processing.org/t/getting-message-that-y-is-not-defined/33028>\
**Category:** Coding Questions\
**Created:** [October 23, 2021, 11:38pm UTC](https://discourse.processing.org/t/getting-message-that-y-is-not-defined/33028 "2021-10-23T23:38:03Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kenga123456](https://avatars.discourse-cdn.com/v4/letter/k/f08c70/32.png) [@Kenga123456](https://discourse.processing.org/u/Kenga123456)\
**Post date:** [October 23, 2021, 11:38pm UTC](https://discourse.processing.org/t/getting-message-that-y-is-not-defined/33028/1 "2021-10-23T23:38:03Z")

</div>

```auto
class Drop {
	float x = random(0, width);
	float y = random(-100, -300);
	float ySpeed = 2;

	void fall() {
		y = y + ySpeed
		
		if (y < height) {
			y = random(-100, -300);
			
		}
	}

	void show() {
		stroke(192, 225, 228);
		line(x, y, x, y + 10);
	}

} //end

Drop[] drops = new Drop[200];

void setup() {
	size(640, 360);
	for (int i = 0; i < drops.length; i++;) {
		drops[i] = new Drop();
	}
}

void draw() {
	background(100);
	
	for (int i = 0; i < drops.length; i++) {
	drops[i].fall();
	drops[i].show();
		
}

}

Problem occurs with this code

if (y < height) {
			y = random(-100, -300);
			
		}
```

---

<div class="post-metadata">

**Author:** ![hotfooted](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/hotfooted/32/3670_2.png) [@hotfooted](https://discourse.processing.org/u/hotfooted)\
**Post date:** [October 24, 2021, 12:09am UTC](https://discourse.processing.org/t/getting-message-that-y-is-not-defined/33028/2 "2021-10-24T00:09:50Z")

</div>

you are missing a semi-colon. welcome to where’s wally programmer style.

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [October 24, 2021, 10:17am UTC](https://discourse.processing.org/t/getting-message-that-y-is-not-defined/33028/3 "2021-10-24T10:17:09Z")

</div>

> [@Kenga123456](#):
>
> ```auto
> void fall() {
> y = y + ySpeed
> 		
> 
> ```

Missing semicolon

Remember to hit ctrl-t when in processing

---

<div class="post-metadata">

**Author:** ![Kenga123456](https://avatars.discourse-cdn.com/v4/letter/k/f08c70/32.png) [@Kenga123456](https://discourse.processing.org/u/Kenga123456)\
**Post date:** [October 24, 2021, 11:09am UTC](https://discourse.processing.org/t/getting-message-that-y-is-not-defined/33028/4 "2021-10-24T11:09:58Z")

</div>

Thanks 🙂 didnt see it

---

<div class="post-metadata">

**Author:** ![Kenga123456](https://avatars.discourse-cdn.com/v4/letter/k/f08c70/32.png) [@Kenga123456](https://discourse.processing.org/u/Kenga123456)\
**Post date:** [October 24, 2021, 11:10am UTC](https://discourse.processing.org/t/getting-message-that-y-is-not-defined/33028/5 "2021-10-24T11:10:34Z")

</div>

im using chromebook so im using openprocessing

---

<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:** [October 24, 2021, 2:40pm UTC](https://discourse.processing.org/t/getting-message-that-y-is-not-defined/33028/6 "2021-10-24T14:40:18Z")

</div>

Hello @Kenga123456,

> [@Kenga123456](#):
>
> im using chromebook so im using openprocessing

Please mention that you are using _Chromebook_ and _OpenProcessing_ in future posts.

It helps us help you.

`:)`

---

<div class="post-metadata">

**Author:** ![Kenga123456](https://avatars.discourse-cdn.com/v4/letter/k/f08c70/32.png) [@Kenga123456](https://discourse.processing.org/u/Kenga123456)\
**Post date:** [October 27, 2021, 7:24pm UTC](https://discourse.processing.org/t/getting-message-that-y-is-not-defined/33028/7 "2021-10-27T19:24:12Z")

</div>

sure 😉

filler, filler
