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,26 +0,0 @@
// An array to keep track of how often random numbers are picked
float[] randomCounts;
void setup() {
size(800,200);
randomCounts = new float[20];
}
void draw() {
background(255);
// Pick a random number and increase the count
int index = int(random(randomCounts.length));
randomCounts[index]++;
// Draw a rectangle to graph results
stroke(0);
strokeWeight(2);
fill(127);
int w = width/randomCounts.length;
for (int x = 0; x < randomCounts.length; x++) {
rect(x*w,height-randomCounts[x],w-1,randomCounts[x]);
}
}