Square experiment

I played around with the previous code a bit more to create this square pattern.

int x = 10;
int y = 10;
void setup() {
size(800, 800);
 smooth();
}
void draw() {
background(255, 204, 204);
 x++;
 y++;
if (x>60) {
 x= x * -1;
 }
if (y>60) {
 y= y * -1;
 }
 for (int i = 0; i <50; i++) {
 for (int j = 0; j <100; j++) {
 fill(100, 204, 255);
 stroke(204, 50, 255);
 rect(i * 50, j * 50, x, y); //changing the shape and how many times the x                                and y coordinates are multiplied by to 
                               increase the size of the squares 
 }
 }
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s