Pls help me with my homework

Please help me with my homework.

No.1
-Size 500 x 500
-Background: White
-Rectangle start: x = 10, y = 30
-Rectangle size 40 horizontal and 30 vertical
-Use width / height variables
-Color: Make gradiation occur

I wrote so far without using the width and height variables.

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

void draw(){
  background(255);
  rectMode(CORNER);
  int x = 10, y = 30;
  for (int i = 0; i < 230; i +=30){
    fill(200, 150, i);
    rect(x, y, 40, 30);
    x+=40;
    y+=30;
    rect(x, y, 40, 30);
    x+=40;
    y-=30;
  }
}

No

i<width/2

?

Regards,

Chrisir

Thanks

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

void draw(){
  background(255);
  rectMode(CORNER);
  int i = 0;
  for (int y = 30; y < width; y +=100){
    i += 20;
    for (int x = 10; x < height; x +=40){
      // fill(x+i, height/x-45, 211, 150);
      fill(#0AE6F0, x-i);
      rect(x, y, 40, 30);
      x+=40;
      y+=30;
      fill(#0AE6F0, x-i);
      rect(x, y, 40, 30);
      y-=30;
    }
  }
}