thenet-array-version2

Processing Day 9: THIS IS SO COOL

Ok, I’m totally nerding out. After my sketch from yesterday, I took two more seconds, wrote four more lines of code, and created THIS!

thenet-array-version2

INFOGRAPHICS CLASS Eat your HEART out! Man I wish I would have used this program from my infographics class two semesters ago. I drew a poster with a million tiny little pixels on it and I did it all by hand. I bet I could have used an array to figure out how to draw them instead, and they would have been more precise!

Although now all of the stroke shapes have been changed to the blue, and the red stroke color from the last sketch is being ignored. I will see if I can fix that.

Here is the code:

size(600,600);
background(255);
smooth();
strokeWeight(2);
stroke(#990000);

int n = 1000;
float[] xTop = new float[n];
float[] xBottom = new float[n];

//make a loop to fill those in
for(int i = 0; i < n; i++) {
   xTop[i] = random(0, 600); 
 xBottom[i] = random(0, 600); 
 fill(#FF9900, 30);
 ellipse(xTop[i], xBottom[i], 100, 100);
 
 fill(#BFE5F3);
 strokeWeight(2);
 stroke(#24476B);
 rect(xTop[i], xBottom[i], 20, 20);
}