# Fill the screen with maroon

**URL:** <https://discourse.processing.org/t/fill-the-screen-with-maroon/9525>\
**Category:** Coding Questions\
**Tags:** homework\
**Created:** [March 22, 2019, 8:00am UTC](https://discourse.processing.org/t/fill-the-screen-with-maroon/9525 "2019-03-22T08:00:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrewyu](https://avatars.discourse-cdn.com/v4/letter/a/8dc957/32.png) [@andrewyu](https://discourse.processing.org/u/andrewyu)\
**Post date:** [March 22, 2019, 8:00am UTC](https://discourse.processing.org/t/fill-the-screen-with-maroon/9525/1 "2019-03-22T08:00:00Z")

</div>

Hi I need help with code. It’s actually for school. And they want the ui to look that its going to fill the row with maroon using frameRate from left to right. Once its filled the next row will be filled. Here’s the code I just need to fill them up. I know there are other ways to do it, but I need to fill them as asked, and I only got one part right which is the fill.

```auto
float x=0;
float y=0;

void setup(){
  size(500,500);
  frameRate(__);
}

void draw(){
if(x<__){
__(123,17,19);  
fill(123,17,19); 
rect(x,y,25,25);
  
__+=25;
}

____ (){
  x = __;
  y = __;
}

}

```

---

<div class="post-metadata">

**Author:** ![cansik](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/cansik/32/8815_2.png) [@cansik](https://discourse.processing.org/u/cansik)\
**Post date:** [March 22, 2019, 8:51am UTC](https://discourse.processing.org/t/fill-the-screen-with-maroon/9525/2 "2019-03-22T08:51:45Z")

</div>

The idea of this board is not to let others write your code. If you have a specific question for a particular problem, you can ask that question and then people try to help you.

So please ask a specific question about, where you are struggling. What you pasted here looks like the homework task, even without real names for the variables and the framerate.

Just a little hint: Try to divide the problem into subproblems and start with the first one (f.e. filling the gaps)

---

<div class="post-metadata">

**Author:** ![andrewyu](https://avatars.discourse-cdn.com/v4/letter/a/8dc957/32.png) [@andrewyu](https://discourse.processing.org/u/andrewyu)\
**Post date:** [March 22, 2019, 9:13am UTC](https://discourse.processing.org/t/fill-the-screen-with-maroon/9525/3 "2019-03-22T09:13:55Z")

</div>

Sorry florian, i was a bit frustrated because it was a 30 minute task i needed to do. It is actually a fill in the blanks type of task. They said filling it up with the necessary code would make it look like filling the screen with maroon with rect from left to right to the next row until it reaches the bottom. I was only able to make it from left to right on the first row with this code:

```auto
float x=0;
float y=0;

void setup(){
  size(500,500);
  frameRate(4);
}

void draw(){
if(x<width){
stroke(123,17,19);  
fill(123,17,19); 
rect(x,y,25,25);
  
x+=25;
}
/*
____ (){
  x = 0;
  y = x;

}
*/
}

```

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [March 22, 2019, 9:43am UTC](https://discourse.processing.org/t/fill-the-screen-with-maroon/9525/4 "2019-03-22T09:43:06Z")

</div>

very good!, so next step could be?

```auto
if() {} else {//??}

```

[https://processing.org/reference/else.html](https://processing.org/reference/else.html)

---

<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:** [March 22, 2019, 10:48am UTC](https://discourse.processing.org/t/fill-the-screen-with-maroon/9525/5 "2019-03-22T10:48:35Z")

</div>

Programming is like explaining something to a dumb friend, who must do a task for you

What you tell him…?

Draw rects and increase the y position.

What should he do when reaching the bottom? What happens to x and y?

Grab a pen and paper and figure it out
