///////////////////////////////////////////////////////////// // Subject: Intro. to Computational Media- Final Project // // Written by: Kate Bauer // // Date: December 12, 2005 // // Version: 3.0 // ///////////////////////////////////////////////////////////// //Declare variables int xpos = 500; // xpos (horizontal position) int ypos = 500; // ypos (vertical position) //NOUNS________________________________________________________ String[] nounsPl = { // array of nouns "elephants","subways", "airplanes", "mountains", "trucks", "violins", "mice", "mosquitos"}; String[] nouns = { // array of nouns "bear","lace", "photograph", "lion", "street", "tea", "paper airplane"}; String[] nouns2 = { // array of nouns "waffle","baseball", "oil", "newspaper", "rain", "wire", "book", "flower", "monster"}; String[] nouns3 = { // array of nouns "pumpkin","basement", "bunny", "spider", "umbrella", "marble", "water balloon", "city", "glass","museum"}; String[] properNouns = { // array of proper nouns "Pencil","Telephone", "Paintbrush", "Fork", "Goldfish"}; //VERBS________________________________________________________ String[] verbs = { // array of verbs "scattered", "raced", "fell", "devoured", "skipped"}; String[] verbsPr = { // array of verbs "take", "see", "eat", "understand", "move","develop","break","open"}; //ADJECTIVES________________________________________________________ String[] adjectives = {//array of adjectives "strange", "dark", "violent", "peaceful"}; String[] adjectives2 = {//array of adjectives "wide", "new", "different", "significant"}; PFont myFont; // declare font variable void setup(){ size(850,425); // set applet size myFont = loadFont("CaslonAntique-48.vlw"); //load font textFont(myFont); //name font // noCursor(); } void draw(){ //draw function background(#FFFFBB); // set background of applet //NOUNS________________________________________________________ // chose noun based on horizontal (x) position of mouse int whichNounPl = constrain((nounsPl.length) * mouseX/width, 0, nounsPl.length-1) ; // chose noun based on horizontal (x) position of mouse int whichNoun = constrain((nouns.length) * mouseX/width, 0, nouns.length-1) ; // chose noun based on horizontal (x) position of mouse int whichNoun2 = constrain((nouns2.length) * mouseX/width, 0, nouns2.length-1) ; // chose noun based on horizontal (x) position of mouse int whichNoun3 = constrain((nouns3.length) * mouseX/width, 0, nouns3.length-1) ; // choose a proper noun based on vertical(y) position of mouse int whichProperNoun = constrain((properNouns.length) * mouseY/height,0,verbs.length-1) ; //VERBS________________________________________________________ // choose a verb based on vertical(y) position of mouse int whichVerb = constrain((verbs.length) * mouseY/height,0,verbs.length-1) ; // choose a verb based on vertical(y) position of mouse int whichVerbPr = constrain((verbsPr.length) * mouseY/height,0,verbsPr.length-1) ; //ADJECTIVES________________________________________________________ // choose a adjective based on vertical(y) position of mouse int whichAdjective = constrain((adjectives.length) * mouseY/height,0,adjectives2.length-1) ; // choose a adjective based on vertical(y) position of mouse int whichAdjective2 = constrain((adjectives2.length) * mouseY/height,0,adjectives2.length-1) ; //POEM: "The Road Not Taken" by Robert Frost textSize(22);//set title text size fill(0); //text color text("The" + " " + properNouns[whichProperNoun] + " " + "Not Taken",30,30); textSize(18); //set paragraph text size // display the text in the applet text("Two" + " " + nounsPl[whichNounPl] + " " +"diverged in a" + " " +adjectives2[whichAdjective2] + " " + nouns2[whichNoun2], 30, 80); text("And sorry I could not" + " " + verbsPr[whichVerbPr] + " " + "both,", 30, 110); text("And be" + " " + adjectives[whichAdjective] + " " + nouns[whichNoun] + ", " + "long I stood,", 30, 140); text("And" + " " + verbs[whichVerb] + " "+ "down" + " " + "as far as I could", 30, 170); text("To where it" + " " + verbs[whichVerb] + " " + "in the" + " " + nouns3[whichNoun3] + ".", 30, 200); text("Then" + " " + verbs[whichVerb] + " " + "the other, as just as" + " " + adjectives[whichAdjective] + ",", 30, 250); text("And having perhaps the better" + " " + nouns[whichNoun] + ",", 30, 280); text("Because it was" + " " + adjectives2[whichAdjective2] + " " + "and wanted" + " " + nouns2[whichNoun2] + ";", 30, 310); text("Though as for that the" + " " + nouns3[whichNoun3] + " " + "there", 30, 340); text("Had" + " " + verbs[whichVerb] + " " + "them really about the same,", 30, 370); text("And both that" + " " +nouns[whichNoun] + " " + "equally lay", 400, 80); text("In" + " " + nounsPl[whichNounPl] + " " + "no step had" + " " + verbs[whichVerb] + " " + "black.", 400, 110); text("Oh, I" + " " + verbs[whichVerb] + " " + "the first for another" + " " + nouns3[whichNoun3] + "!", 400, 140); text("Yet knowing how" + " " + nouns2[whichNoun2] + " " + "leads on to" + " " + nouns[whichNoun] + ",",400, 170); text("I" + " " + verbs[whichVerb] + " " + "if I should ever" + " " + verbsPr[whichVerbPr] + " " + "back.", 400, 200); text("I shall be telling this with a" + " " + nouns3[whichNoun3], 400, 250); text("Somewhere" + " " + nounsPl[whichNounPl] + " " + "and" + " " + nounsPl[whichNounPl] + " " + "hence:",400, 280); text("Two" + " " + nouns2[whichNoun2] + " " + "diverged in a" + " " + nouns[whichNoun] + ", " + "and I--", 400, 310); text("I took the" + " " + nouns[whichNoun] + " " + "less traveled by,", 400, 340); text("And that has made all the" + " " + nouns3[whichNoun3] + ".", 400, 370); }