2008年4月7日 星期一

for + random


processing

CODE:
void setup(){
size(800,600);
background(255,255,255);
noLoop();
}

void draw(){
for(int i=0;i<400;i++)
{
float x,y,lx,ly;
// Random rand = new Random();
x = random(0,800);
y = random(0,600);
lx = random(0,100);
ly = random(0,100);
rect(x,y,lx,ly);
}
}

沒有留言: