removing old nature of code examples before adding new ones

This commit is contained in:
shiffman
2012-12-11 20:01:56 +00:00
parent e3aff605a8
commit 9b4891e419
541 changed files with 0 additions and 35009 deletions
@@ -1,34 +0,0 @@
// Daniel Shiffman
// The Nature of Code
// http://www.shiffman.net/
int x,y;
void setup() {
size(200,200);
background(0);
smooth();
}
void draw() {
//create an alpha blended background
fill(0,1);
rect(0,0,width,height);
//calculate a probability between 0 and 100% based on mouseX location
float prob = (mouseX / (float) width);
//get a random floating point value between 0 and 1
float r = random(1);
//test the random value against the probability and trigger an event
if (r < prob) {
noStroke();
fill(255);
ellipse(x,y,10,10);
}
// X and Y walk through a grid
x = (x + 10) % width;
if (x == 0) y = (y + 10) % width;
}