PROCESSING__ practicing integers, random, and for loops (studio II – glitch)

IMAGES::

gitch010 gitch023 gitch024 gitch035

VIDEO::

CODE::


void setup(){
size(800,400);
frameRate(5);
colorMode(HSB,100);
noStroke();
}

int h=0;
int s=20;
int n=70;

void draw(){

for(int y=0; y<height;y=y+h){

for(int x=0; x<width;x=x+s){

fill (random(100),20,100);
rect(x,y,s,h);
}
h=(h+1)%100;

}

}

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