Labels

Thursday, 22 March 2012

Re-worked Code

I re-worked my so my variables can be changed easily to create new forms.
New Code :


int j = 0;
int w = 100;
int h = 100;
int x = 50;
int y = 0;
void setup() {
  size(500, 500);
  background(255);
}
void draw() {
  while(j<3) {
   
    int i = 0;
    while(i<j+1){
      rect(x+w*i+(w/2)*(3-j),y+j*h,w,h);
      i=i+1;
    }
   
    j= j+1;
  }
}

No comments:

Post a Comment