// So Young's ICM Midterm Project~!! // Cast your today's horoscope~!! // It'll show your today's Style, Mood, Love and Money~. // Type your name and birthday(mmdd). // Whatever your horoscope is, you're Gorgeous~!! // Blue Flowers on the left : your mood // Chanel & Prada models : your style // Hot Stars : your love // Nice Cars : your money PFont f1,f2,f3; //----------------------------------------------------------------------------for Images PImage [] men = new PImage[10]; // female's lovers PImage [] women = new PImage[10]; // male's lovers PImage [] male = new PImage[6]; //male's style PImage [] female = new PImage[6]; //female's style boolean MEN = false; //show or not boolean WOMEN = false; //show or not boolean MALE = false; //show or not boolean FEMALE = false; //show or not PImage [] car = new PImage[10]; // money PImage [] flower = new PImage[6]; // mood PImage backGround; // background image PImage who; // Who am I ? //---------------------------------------------------------------------------- for coool random int[] thestuff = { -1,-1,-1,-1,-1,-1,-1,-1,-1,-1}; boolean[] isused = new boolean[10]; int therandom, j; int num1, num2, num3; //---------------------------------------------------------------------------- getting data~ String[] months = { "1","2","3","4","5","6","7","8","9","10","11","12"}; int count ; int a; // alpha for manythings int aa = 255; // alpha for "who" String bir=""; // typed birthday String name = ""; // typed name String myname = ""; // show my name boolean Name = false; //show or not boolean myName = false; //show or not String myHoroscope = ""; // show my horoscope String Again = ""; // try again~! int birthday; // birthday as number int Love, love; int Money, money; int Mood,mood ; int Style, style; //---------------------------------------------------------------------------- for Date int d = day(); int m = month(); int y = year(); String D = String.valueOf(d); String M = String.valueOf(m); String Y = String.valueOf(y); //---------------------------------------------------------------------------- setup void setup(){ size(850,730); for(int i1=0; i10){ if (keyCode == BACKSPACE){ name = name.substring(0, len1 - 1); } } else if (keyCode == SHIFT) { name = name; } } if(myName){ int len = bir.length(); bir = bir+key; if(len>0){ if (keyCode == BACKSPACE){ bir = bir.substring(0, len - 1); } } else if (keyCode == SHIFT) { bir = bir; } } } //---------------------------------------------------------------------------- void mousePressed() { if(mouseX>=144 && mouseX<=376 && mouseY>=645 && mouseY<=684){ // click for typing name Name=true; myName=false; } if(mouseX>=496 && mouseX<=605 && mouseY>=645 && mouseY<=684){ // click for typing birthday myName=true; Name=false; } if(mouseX>=656 && mouseX<=698 && mouseY>=645 && mouseY<=684){ // click male a=255; // show images MEN = false; WOMEN = true; MALE = true; FEMALE = false; aa=0; // hide who birthday = int(bir); // change birthday to int horoscope(); showMine(); getNum(); bir = ""; } if(mouseX>=735 && mouseX<=777 && mouseY>=645 && mouseY<=684){ // click female a=255; MEN = true; WOMEN = false; MALE = false; FEMALE = true; aa=0; birthday = int(bir); horoscope(); showMine(); getNum(); bir = ""; } } //---------------------------------------------------------------------------- String Gethoroscope(String mine) { // initialization int numItems = 0; int currentItem = 0; int currentPos = 0; String horoscope; // build the URL String proxyURL = "http://itp.nyu.edu/icm/proxy/proxy.php?url="; String myURL = "http://my.horoscope.com/getHoroscope.asp?day=" +D+"&month="+M+"&year="+Y+"&sign="+mine+"&inyear=1970"; String queryURL = proxyURL + myURL ; String[] lines = loadStrings(queryURL); String oneLongString = join(lines, ""); //---------------------------------------------------------------------------- // Searching for love String itemBegin = "Love:
=321 && birthday<=331) || (birthday >=401 && birthday<=419)) { myHoroscope = "Aries"; Again = ""; count =0; } else if( (birthday>=420 && birthday<=430) || (birthday >=501 && birthday<=520)) { myHoroscope = "Taurus"; Again = ""; count =1; } else if( (birthday>=521 && birthday<=531) || (birthday >=601 && birthday<=621)) { myHoroscope = "Gemini"; Again = ""; count =2; } else if( (birthday>=622 && birthday<=630) || (birthday >=701 && birthday<=722)) { myHoroscope = "Cancer"; Again = ""; count =3; } else if( (birthday>=723 && birthday<=731) || (birthday >=801 && birthday<=822)) { myHoroscope = "Leo"; Again = ""; count =4; } else if( (birthday>=823 && birthday<=831) || (birthday >=901 && birthday<=922)) { myHoroscope = "Virgo"; Again = ""; count =5; } else if( (birthday>=923 && birthday<=930) || (birthday >=1001 && birthday<=1022)) { myHoroscope = "Libra"; Again = ""; count =6; } else if( (birthday>=1023 && birthday<=1031) || (birthday >=1101 && birthday<=1121)) { myHoroscope = "Scorpio"; Again = ""; count =7; } else if( (birthday>=1122 && birthday<=1130) || (birthday >=1201 && birthday<=1221)) { myHoroscope = "Sagittarius"; Again = ""; count =8; } else if( (birthday>=1222 && birthday<=1231) || (birthday >=101 && birthday<=119)) { myHoroscope = "Capricorn"; Again = ""; count =9; } else if( (birthday>=120 && birthday<=131) || (birthday >=201 && birthday<=218)) { myHoroscope = "Aquarius"; Again = ""; count =10; } else if( (birthday>=219 && birthday<=229) || (birthday >=301 && birthday<=320)) { myHoroscope = "Pisces"; Again = ""; count =11; } else{ // if type wrong # "try again~!!! myHoroscope = ""; Again = "! Try Again!"; if(mousePressed==true){ a=0; aa=255; hideMine(); } } Gethoroscope(months[count]); } //---------------------------------------------------------------------------- void showMine(){ // show images Love=love; Money=money; Mood=mood; Style=style; myname = name; name=""; } //---------------------------------------------------------------------------- void hideMine(){ // hide images Mood=0; Style=0; } //---------------------------------------------------------------------------- cool random~!! void getNum(){ // get different random numbers in array~!! I don't wanna see same image!!! boolean[] isused = new boolean[10]; j = 0; while(j<10) { therandom = int(random(10)); if(isused[therandom]==false){ thestuff[j] = therandom; isused[therandom] = true; j++; } } } //---------------------------------------------------------------------------- // A function that returns a substring between two substrings String giveMe(String s, String before, String after) { String found = ""; int start = s.indexOf(before); // Find the index of the beginning tag if (start == -1) return ""; // If we don't find anything, send back //a blank String start += before.length(); // Move to the end of the beginning tag int end = s.indexOf(after,start); // Find the index of the end tag if (end == -1) return ""; // If we don't find the end tag, send back //a blank String return s.substring(start,end); // Return the text in between } // The End!!!!! // I want to sleeeeeeeeeeeeeep .........T.T