Hey, I'm trying to build these stairs made with rectangles. The user enters the number of stairs and half should be red, the other half should be blue. I've been stuck for two days. Can anyone give me some advice?
This is the example http://imgur.com/Qv9vu
int maxStep = 10;
float x = 50;//initial pos
float y = 50;
int i;
for(i=0; i<minStep/2; i++){
drawRect(red, x, y, 20, 10); //whatever you are using to draw rect. assuming dimensions are 20x10
x +=10;
y +=10;
}
for(; i<maxStep; i++){
drawRect(blue, x, y, 20, 10); //whatever you are using to draw rect. assuming dimensions are 20x10
x +=10;
y +=10;
}