# Need help for a grid

**URL:** https://discourse.processing.org/t/need-help-for-a-grid/30851
**Category:** Coding Questions
**Created:** [June 22, 2021, 1:33pm UTC](https://discourse.processing.org/t/need-help-for-a-grid/30851 "2021-06-22T13:33:40Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![sympathetic](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@sympathetic](https://discourse.processing.org/u/sympathetic)
#### Post date: [June 22, 2021, 1:33pm UTC](https://discourse.processing.org/t/need-help-for-a-grid/30851/1 "2021-06-22T13:33:41Z")

</div>

Hi, my english is not that good i hope you understand. So I have a grid with a for cycle and wanted it to map the brightness of an ellipse, but don’t really know how to code it.

int a = 20;

void setup () {  
size(800, 800);  
ellipse(a,a,a_20,a_20);  
}

void draw() {  
background(255);  
// ellipse(a,a,a_20,a_20);  
fill(0);  
noStroke();

float tiles = mouseX/3;  
float tileSize = width/tiles;

translate(tileSize/2, tileSize/2);

for (int x = 0; x \< tiles; x++) {  
for (int y = 0; y \< tiles; y++) {

```
   float size = map(brightness(a), 0, 255, tileSize, 0);

  ellipse(x*tileSize, y*tileSize, size, size);
  
 
}

```

}  
}

---

<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: [June 22, 2021, 2:20pm UTC](https://discourse.processing.org/t/need-help-for-a-grid/30851/2 "2021-06-22T14:20:16Z")

</div>

Hello,

There are resources (tutorials, references, examples) here:  
_[processing.org](http://processing.org)_

Please format your code as a courtesy to the community:  
[https://discourse.processing.org/faq#format-your-code](https://discourse.processing.org/faq#format-your-code)

`:)`
