//Claire Castleman //ccastlem@andrew.cmu.edu //Section D void setup() { size(500,500); background(0, 0, 0); smooth(); frameRate(5); draw(); println("Homework #4"); println("Random Initials"); } void draw() { float iWidth = random(width/50, width/2); float iHeight = random(height/50, height/2); float x = random(width - 1.7*iWidth - 3); float y = random(-.05*iHeight, height - .9*iHeight); fill(0,0,0,70); noStroke(); rect(0,0,width,height); drawInitials(x, y, iWidth, iHeight); } void drawInitials(float x, float y, float iWidth, float iHeight) { noFill(); strokeWeight(4); stroke(random(256), random(256), random(256)); beginShape(); curveVertex(x + .6*iWidth, y + .1*iHeight); curveVertex(x + .4*iWidth, y + .15*iHeight); curveVertex(x + .2*iWidth, y + .20*iHeight); curveVertex(x, y + .5*iHeight); curveVertex(x + .2*iWidth, y + .80*iHeight); curveVertex(x + .4*iWidth, y + .85*iHeight); curveVertex(x + .6*iWidth, y + .9*iHeight); endShape(); // First C noFill(); stroke(random(256), random(256), random(256)); strokeWeight(4); beginShape(); curveVertex(x + .8*iWidth, y + .1*iHeight); curveVertex(x + .7*iWidth, y + .2*iHeight); curveVertex(x + .7*iWidth, y + .3*iHeight); curveVertex(x + .6*iWidth, y + .4*iHeight); curveVertex(x + .8*iWidth, y + .5*iHeight); curveVertex(x + .7*iWidth, y + .6*iHeight); curveVertex(x + .9*iWidth, y + .7*iHeight); curveVertex(x + .7*iWidth, y + .8*iHeight); curveVertex(x + .8*iWidth, y + .9*iHeight); endShape(); // Very Squiggly I noFill(); stroke(random(256), random(256), random(256)); strokeWeight(4); beginShape(); curveVertex(x + 1.6*iWidth, y + .25*iHeight); curveVertex(x + 1.6*iWidth, y + .25*iHeight); curveVertex(x + 1.5*iWidth, y + .20*iHeight); curveVertex(x + 1.6*iWidth, y + .15*iHeight); curveVertex(x + 1.7*iWidth, y + .20*iHeight); curveVertex(x + 1.6*iWidth, y + .25*iHeight); curveVertex(x + 1.3*iWidth, y + .3*iHeight); curveVertex(x + 1.1*iWidth, y + .5*iHeight); curveVertex(x + 1.3*iWidth, y + .7*iHeight); curveVertex(x + 1.6*iWidth, y + .75*iHeight); curveVertex(x + 1.6*iWidth, y + .75*iHeight); endShape(); // Second C }