Filling up the canvas with some paint

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:

I hope you could help me. Thank you!

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

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.

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=(...){;

}
}