Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
Confluence
For you

Programming
Results will update as you type.
  • Tiling and Repetition
  • Reactors
  • Programming Basics: Parametric and Generative Graphic Design 2016
  • Archive
  • High Scores
  • Artificial Neural Network
  • Alternatives to the Processing IDE
  • p5.js Programming
  • Programming in Processing (java)
    • Starting with Processing (en)
    • Variables (en)
    • Classes and Objects (en)
    • Events und Functions (en)
    • Writing our own Functions (en)
    • Random Numbers (en)
      • Random numbers (de)
    • Conditionals (en)
    • Loops (en)
    • Nested Loops (en)
    • Coordinates (en)
    • Arrays and Lists (en)
    • SVG + Images (en)
    • Motion and Temporality
    • Gesture Interactions
    • Using bitmaps as modifiers
    • Vectors
    • Animation
    • Animation 2
    • Simple Collision Detection
    • Sound
    • Typography

/
Random Numbers (en)

Random Numbers (en)

Aug 16, 2019

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);
  fill(255);
  stroke(0);
}
   
void draw()
{
  //fill(random(100,150),random(0,100),random(150,255));
  float size = random(10,100);
  ellipse(random(0,width),random(0,height),size,size);
}
, multiple selections available,
{"serverDuration": 13, "requestCorrelationId": "efaa33f52b184eca919ca6152eb65486"}