Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

deutsche Version

Random numbers are often used in programming, everywhere from encrypting data to generative design. Processing offers simple function to get a random number:

random([lower Limit],[upper Limit])  

void setup()
{
  size(300,300);
  background(0);
  noLoop();
}
 
void draw()
{
  stroke(random(100,200));
  fill(random(50,100),random(50,100),random(150,255));
  strokeWeight(random(1,5));
  ellipse(random(0,width),random(0,height),random(10,100),random(10,100));
}
 
void mousePressed()
{
  redraw();
}