## harsh – Clock

IMAGES   GIF EMBED

This project was really fun to work on, with my intention being to make a linguistic representation of time. I first started with trying to tell the time in an interesting way - which simply involved applying a polish notation idea to the time itself, so something like 8:41 would become "eleven past half past eight" - while this was alright, I tried to make it more and more interesting. This led me to make the time more complex, by adding and removing common idioms such as "Half" and "Quarter" from the time. After this, a friend suggested for this complexity to increase the longer the function runs, which I thought was an awesome idea, and was the last thing I implemented.

In its current state, the text overflows from the screen and you must scroll to see the rest, I've currently paused trying to make the text smaller for it to fit in the screen - hopefully, this will come to realization in a future version. (Update- fixed it!)

```let timer = 2;   function getWord(number){   number = int(number);   if (number==1){return "one "} else if (number==2){return "two "} else if (number==3){return "three "} else if (number==4){return "four "} else if (number==5){return "five "} else if (number==6){return "six "} else if (number==7){return "seven "} else if (number==8){return "eight "} else if (number==9){return "nine "} else if (number==10){return "ten "} else if (number==11){return "one " + "past " +"ten "} else if (number==12){return "two " + "past " +"ten "} else if (number==13){return "three " + "past " +"ten "} else if (number==14){return "four " + "past " +"ten "} else if (number==15){return "QUARTER "}   return number.toString();   }   function getWordHour(number){   number = int(number);     if (number==0){return "twelve"} else if (number==1){return "one "} else if (number==2){return "two "} else if (number==3){return "three "} else if (number==4){return "four "} else if (number==5){return "five "} else if (number==6){return "six "} else if (number==7){return "seven "} else if (number==8){return "eight "} else if (number==9){return "nine "} else if (number==10){return "ten "} else if (number==11){return "eleven"} else if (number==12){return "twelve"}   return number.toString();   }   function makeTimeString(listWithShit){ var decimalTime = listWithShit; var changes = listWithShit; var operator = listWithShit;   var decimalTimeString = decimalTime.toString();   var hourString = decimalTimeString.slice(0,2);   if(int(hourString) &gt; 12)   { hourString = int(hourString) - 12; hourString = hourString.toString();   }   else if(int(hourString) &lt; 1) { hourString = int(hourString) + 12; hourString = hourString.toString(); } var minuteString = decimalTimeString.slice(3,5); var minuteStringInt = int(minuteString); minuteStringInt = int( map(minuteStringInt,0,100,0,60) ); var finalString = "" for(var i=operator.length-1; i&gt;=0; i--){ var curOperator = operator[i];   var curChange = changes[i]   if(curChange == 15){curChange = "QUARTER "} else if(curChange == 30){curChange = "HALF "} else if(curChange == 10){curChange = "TEN ";} else if(curChange == 5){curChange = "FIVE ";}   finalString+=curChange;   if(curOperator == "-"){finalString+="past ";} else if(curOperator == "+"){finalString+="to ";} }     var newMinuteString = "";   if(minuteStringInt&gt;=45){ var hourStringInt = int(hourString)+1; hourString = hourStringInt.toString(); var leftOverMinutes = minuteStringInt-45;   if(leftOverMinutes == 0){ newMinuteString = "QUARTER "+"before " } else{ newMinuteString = getWord(leftOverMinutes) + "past " + "QUARTER " + "before " } }   else if(30&lt;=minuteStringInt &amp;&amp; minuteStringInt&lt;45){ var leftOverMinutes = 45-minuteStringInt;   if(leftOverMinutes == 15){ newMinuteString = "HALF "+"past " } else{ newMinuteString = getWord(leftOverMinutes) + "past "+"HALF "+"past " } }   else if(15&lt;=minuteStringInt &amp;&amp; minuteStringInt&lt;30){ if(minuteStringInt == 15){ newMinuteString = "QUARTER "+"past "; } else{ var leftOverMinutes = 30-minuteStringInt; newMinuteString = getWord(leftOverMinutes) + "to "+"QUARTER "+"past "; } }   else if(0&lt;=minuteStringInt &amp;&amp; minuteStringInt&lt;15){ if(minuteStringInt != 0){ newMinuteString = getWord(minuteStringInt) +"past " }   }   var hourStringWord = getWordHour(int(hourString)); //hourStringWord = hourStringWord.slice(0,hourStringWord.length-1);   var timestring = finalString + newMinuteString + hourStringWord + "."   finalString = "It is " + timestring.toLowerCase(); return finalString; }     function complicatedClock(hour,minute){ var currentTime = hour+map(minute,0,60,0,1); var newTime = currentTime;   // LIST TO KEEP TRACK OF ALL THE SUBTRACTIONS/ADDITIONS BEING MADE var changes = [];   // LIST TO KEEP TRACK OF WHETHER THE CHANGES ARE ADDITIONS OR SUBTRACTIONS var operator = [];   var timeChanges = [30,15,10,5];   for(var i = 0; i &lt; timer; i++){   var curIndex = int(random(0,4));   var stepChange = timeChanges[curIndex];   var addOrSubtract = random(0,1);   if(addOrSubtract &lt; 0.5){ changes.push(stepChange); operator.push("+"); newTime = newTime + map(stepChange,0,60,0,1); } else { changes.push(stepChange); operator.push("-"); newTime = newTime-map(stepChange,0,60,0,1); } } return [newTime,changes,operator]; } var curTimeString; var increasing = true; var textYTop = 20; function setup() { createCanvas(500,500); background(50); textFont("Helvetica"); fill(255); noStroke(); curTimeString = makeTimeString(complicatedClock(hour(),minute())); } function keyPressed(){ if (keyCode == ESCAPE){ increasing = false; } else { increasing = true; } } function mouseWheel(event) { textYTop -= event.delta; if(textYTop &gt; 30){ textYTop = 29; }   }   function draw() { rectMode(CORNER); background(50);   if (frameCount % (120) == 0 &amp;&amp; increasing == true){ curTimeString = makeTimeString(complicatedClock(hour(),minute())); timer+= 4; } text(curTimeString,20,textYTop,460,curTimeString.length*100); }```

# Big Brother's Clock  Replacing Minutes with Seconds View:   ### Explanation:

From the beginning, I knew I wanted to experiment with time unconventionally because I love the relativity of time and how it is interpreted.  I began to mess around with the concept of taking time and making each minute into a year by adding the hours and minutes to create the decade in the 1900s. Although it is not an "accurate" representation of time, I liked that it furthered the idea of time's interpretive nature. Originally, I was thinking of sampling a song from a certain year and possibly using APIs to gain access to a variety of music. However, as I experimented with how to compute the year, I was fascinated that although there are technically 24 hours in a day and 60 minutes in a hour, the clock never reaches this technically real but not real time. Furthermore, when inserted into my formula of computing the year, this "ideal" year was 1984. I found that an extremely interested premise that time somewhat revolved around this number and subsequently considering that time revolved around the ideas about society and humanity within the novel. From here, my concept shifted from music to literature considering the significance of the book 1984. Although not complex in code, each book was picked to embody some of the morals shown in 1984.  Each book serves an important purpose and therefore the projection of time through these books is personal and biased based on my experiences. Overall, "Big Brother's Clock" was made through an exploration of the conceptual more than the visual or mathematical.

```//The Clock of 1984 PImage bookBack; int circleX, circleY; int circleSize = 50; color circleColor; color currentColor; boolean circleOver = false; int visible;     void setup() { size(800, 570); bookBack=loadImage("oldBook.jpg"); circleColor = color(255); currentColor=color(209, 142,8); circleX = 180; circleY = 70; visible=-1; ellipseMode(CENTER); }   void draw() { image(bookBack,0,0);   //All 83 Books String[] books = {"The Wonderful Wizard of Oz", "The First Men in the Moon", "Just So Stories", "The People of the Abyss", "The Tale of Peter Rabbit\nand Benjamin Bunny", "The Gift of the Magi", "The Future in America:\nA Search After Realities", "Cautionary Tales for Children", "The Man Who Was Thursday", "The Machine Stops", "Howards End", "The Secret Garden", "The Problems of Philosophy", "The Google Book", "The Beasts of Tarzan", "The Metamorphosis", "Relativity: The Special\nand the General Theory", "His Family", "The Decline of the West:\nPerspectives of world-history", "Strange News from Another Star", "The Age of Innocence", "How to Analyze\nPeople on Sight", "The Velveteen Rabbit", "The Ego and the Id", "So Big", "The Great Gatsby", "Winnie-the-Pooh", "Being and Time", "Nadja", "Is Sex Necessary? Or,\nWhy You Feel the Way You Do", "The Mysterious Universe", "The Story of Babar,\nthe Little Elephant", "Journey to the End\nof the Night", "Lord Edgware Dies", "The Logic of\nScientific Discovery", "It Can't Happen Here", "How to Win Friends\nand Influence People", "The Hobbit", "The Sword in the Stone", "The Secret Life\nof Walter Mitty", "Portrait of the\nArtist as a Young Dog", "The Garden of Forking Paths", "The Stranger", "The Little Prince", "What Is Life?", "Animal Farm", "The Common Sense Book\nof Baby and Child Care", "The Age of Anxiety", "No Longer Human", "Death of a Salesman", "The Martian Chronicles", "The Catcher in the Rye", "The Borrowers", "Fahrenheit 451", "Lord of the Flies", "I can jump puddles", "Aniara", "The Cat in the Hat", "The Computer and the Brain", "Sweet Bird of Youth", "The Weirdstone of Brisingamen", "James and the Giant Peach", "A Wrinkle in Time", "Where the Wild Things Are", "The Giving Tree", "The Autobiography of Malcolm X", "Rosencrantz and\nGuilderstern Are Dead", "The Medium is the Massage:\nAn Inventory of Effects", "Do Androids Dream\nof Electric Sheep?", "Slaughterhouse-Five", "Fantastic Mr. Fox", "A Happy Death", "Frog and Toad Together", "Momo", "The Chocolate War", "Tuck Everlasting", "The Alteration", "Bridge to Terabithia", "The World According to Garp", "The Neverending Story", "Cosmos: A Personal Voyage", "A Light in the Attic", "Life, the\nUniverse and Everything", "Pet Sematary" };     // Fetch the current time int H = hour(); int M = minute(); int arrSpot = H+M; int year = 1900 + (H + M);       noStroke(); PFont font = createFont("BonvenoCF-Light.otf",32); textFont(font); fill(255,255,255); textSize(20); String currTimeString = "19: " + (H) + "+" + nf(M, 2); if (visible&gt;0){ text(currTimeString, 10, 25); text("Hour: " + H, 10, 50); text("Minute: " + M, 10, 75); text(year, 10, 100); } textSize(25); text(books[arrSpot], 300,80);   update(mouseX, mouseY); if (circleOver) { fill(currentColor); } else { fill(circleColor); } ellipse(circleX, circleY, circleSize, circleSize); fill(51); textSize(7); text(" Clock\nBreakdown", circleX-19,circleY-5); text(" Clock\nBreakdown", circleX-19.5,circleY-5); }     //Code Modified From Processing Site void update(int x, int y) { if ( overCircle(circleX, circleY, circleSize) ) { circleOver = true; } else{ circleOver=false; } }   void mousePressed() { if (circleOver) { visible=visible*-1; color temp= circleColor; circleColor=currentColor; currentColor=temp; } } boolean overCircle(int x, int y, int diameter) { float disX = x - mouseX; float disY = y - mouseY; if (sqrt(sq(disX) + sq(disY)) &lt; diameter/2 ) { return true; } else { return false; } }   //Image Credits: BuyBackdrops.com //https://www.buy-backdrop.com/bmz_cache/e/e7d916a4073273331838331e718c7a53.image.300x200.jpg```