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 4 Current »

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(500,500);
  background(255);
  noLoop();
}
  
void draw()
{
  noStroke();
  fill(random(100,150),random(0,100),random(150,255));
  ellipse(random(0,width),random(0,height),random(10,100),random(10,100));
}
  
void mousePressed()
{
  redraw();
}