Random numbers are often used in programming, everywhere from encrypting data to generative design. Processing offers simple function to get a random number:
...
| Code Block |
|---|
void setup()
{
size(300500,300500);
background(0255);
fill(255);
noLoopstroke(0);
}
void draw()
{
stroke//fill(random(100,200));
fill(random(50,100150),random(500,100),random(150,255));
strokeWeight(float size = random(110,5)100);
ellipse(random(0,width),random(0,height),random(10,100),random(10,100));
}
void mousePressed()
{
redraw(size,size);
} |