# Filling up the canvas with some paint

**URL:** <https://discourse.processing.org/t/filling-up-the-canvas-with-some-paint/28210>\
**Category:** Coding Questions\
**Tags:** homework\
**Created:** [March 3, 2021, 5:22am UTC](https://discourse.processing.org/t/filling-up-the-canvas-with-some-paint/28210 "2021-03-03T05:22:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Apollo](https://avatars.discourse-cdn.com/v4/letter/a/41988e/32.png) [@Apollo](https://discourse.processing.org/u/Apollo)\
**Post date:** [March 3, 2021, 5:22am UTC](https://discourse.processing.org/t/filling-up-the-canvas-with-some-paint/28210/1 "2021-03-03T05:22:26Z")

</div>

Hi!

I hope you could help me here.

The code should create a 500x500 canvas and fills it in with a solid color (try maroon) using a 25px brush in 20 seconds. The brush goes from left to right for a layer/level/row, then starts again on the next layer/level/row.

My Professor gave this layout as a guide:

 ![Untitled2](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/1/111a4d51c8d835b62e0e35032226a0e51a3a07d2.jpeg)

I hope you could help me. Thank you!

---

<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 3, 2021, 7:05am UTC](https://discourse.processing.org/t/filling-up-the-canvas-with-some-paint/28210/2 "2021-03-03T07:05:36Z")

</div>

No…

the idea is that you try it first.

Show your attempt and your code, the path for the solution you came up with and then asked details about where you are stuck

Same for your other question

---

<div class="post-metadata">

**Author:** ![Apollo](https://avatars.discourse-cdn.com/v4/letter/a/41988e/32.png) [@Apollo](https://discourse.processing.org/u/Apollo)\
**Post date:** [March 3, 2021, 7:49am UTC](https://discourse.processing.org/t/filling-up-the-canvas-with-some-paint/28210/3 "2021-03-03T07:49:46Z")

</div>

This is how far I got from answering this. If you’d notice, there isn’t much I know. And I think what I put in are still incorrect.

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

void setup(){
size(500,500)
frameRate(25)
}

void draw (){
if(x<...) // I'm stuck here
()
color(123,17,19);
rect(x,y,25,25);
x=...25; // I don't know what I'm gonna put here

}

void display(
x=(...){; 
y=(...){;

}
}

```
