# Eliza Pratt – Project 09

``````/*
Eliza Pratt
Section E
elpratt@andrew.cmu.edu
Project - 09
*/

var pic;
var dev = 50; //starting deviation for coordinate positon

//array of letters to be drawn
var letter = ["A", "B", "C", "D", "E", "F", "G", "H", "I",
"J", "K", "L", "M", "N", "O", "P",  "Q",
"R", "S", "T", "U", "V", "W", "X", "Y", "Z"];

var friends = "https://i.imgur.com/7k2A67W.jpg";
}

function setup() {
createCanvas(360, 480);
background(235, 184, 16);
imageMode(CENTER);

}

function draw() {

//selects a random size
var r = random(6, 10);

//selects a random angle
var angle = random(360);

//incrementally increases the deviation of coordinates
//after a certain number of frames
if (frameCount > 600) dev = 100;
else if (frameCount > 1000) dev = 240;

//randomly assigns position
var px = randomGaussian(width / 2, dev);
var py = randomGaussian(height / 2, dev);

//contrains random values to the canvas
var picX = constrain(floor(px), 0, width);
var picY = constrain(floor(py), 0, height);

//retrieves color from pixel at random coordinate
var col = pic.get(picX, picY);

strokeWeight(2);
stroke(col);
noFill();
textSize(r);

//retrieves a random index for the letter array
var i = floor(random(25));

//draws and rotates letter
push();
translate(px, py);