測姻緣javascript指令碼

來源:互聯網
上載者:User
<CENTER><script LANGUAGE="Javascript"> <!-- Distributed by http://www.hypergurl.comvar howMany = 50 var quote = new Array(howMany+1) quote[0]="A good womanto a man is like money in the bank." quote[1]="God loved the birds andinvented trees. Man loved the birds and invented cages." quote[2]="Thewords that enlighten the soul are more precious than jewels." quote[3]="Prepareyour mind to receive the best that life has to offer." quote[4]="Inorder to be walked on, you have to be lying down." quote[5]="Educationis the power to think clearly, the power to act well in the world's work, andthe power to appreciate life." quote[6]="No one can make you feel inferiorwithout your consent." quote[7]="A person who aims at nothing is sureto hit it." quote[8]="Shoot for the moon. Even if you miss, you'll landamong the stars." quote[9]="No bird soars too high if he soars withhis own wings." quote[10]="You can't build a reputation on what you'regoing to do." quote[11]="An invasion of armies can be resisted, butnot an idea whose time has come." quote[12]="The people who oppose yourideas are inevitably those who represent the established order that your ideaswill upset." quote[13]="You don't love a woman because she is beautiful,but she is beautiful because you love her." quote[14]="Love is the immortalflow of energy that nourishes, extends and preserves. Its eternal goal is life."quote[15]="Sometimes the heart sees what is invisible to the eye." quote[16]="Woeto the man whose heart has not learned while young to hope, to love - and to putits trust in life." quote[17]="Learn from yesterday, live for today,hope for tomorrow." quote[18]="Enjoy life. There's plenty of time tobe dead." quote[19]="Here is the test to find whether your mission onEarth is finished: if you're alive, it isn't." quote[20]="The questionis not whether we will die, but how we will live." quote[21]="Neverbe bullied into silence. Never allow yourself to be made a victim. Accept no one'sdefinition of your life; define yourself." quote[22]="Believe that lifeis worth living and your belief will help create the fact." quote[23]="Liveevery day as if it were your last, because one of these days, it will be."quote[24]="Most people would rather be certain they're miserable, than riskbeing happy." quote[25]="To live a pure unselfish life, one must countnothing as one's own in the midst of abundance." quote[26]="The grandessentials of happiness are: something to do, something to love, and somethingto hope for." quote[27]="Nobody really cares if you're miserable, soyou might as well be happy." quote[28]="Great ability develops and revealsitself increasingly with every new assignment." quote[29]="If a mandeceives me once, shame on him; if he deceives me twice, shame on me." quote[30]="Remember:It is 10 times harder to command the ear than to catch the eye." quote[31]="Thereare many paths to the top of the mountain, but the view is always the same."quote[32]="If you can't win, make the fellow ahead of you break the record."quote[33]="If you really put a small value upon yourself, rest assured thatthe world will not raise your price." quote[34]="Choose the life thatis most useful, and habit will make it the most agreeable." quote[35]="Alwaysbehave as if nothing had happened, no matter what has happened." quote[36]="Whenfate hands us a lemon, let's try to make lemonade." quote[37]="Reflecton your present blessings, of which every man has many, not on your past misfortunes,of which all men have some." quote[38]="Don't be afraid to take a bigstep when one is indicated. You can't cross a chasm in two small steps."quote[39]="When someone does something good, Applaud! You will make two peoplehappy." quote[40]="Duty is the sublimest word in our language. Do yourduty in all things. You cannot do more. You should never do less." quote[41]="Alwaysremember others may hate you but those who hate you don't win unless you hatethem. And then you destroy yourself." quote[42]="Do not wait for extrordinarycircumstances to do good; try to use ordinary situations." quote[43]="Wheneveryou are asked if you can do a job, tell 'em, "Certainly, I can!" Thenget busy and find out how to do it." quote[44]="Remember that thereis nothing stable in human affairs; therefore avoid undue elation in prosperity,or undue depression in adversity." quote[45]="Learn to say 'No'; itwill be of more use to you than to be able to read Latin." quote[46]="Letus not be too particular; it is better to have old secondhand diamonds than noneat all." quote[47]="Never believe all you hear. Always believe in whatyou say." quote[48]="Wise men learn more from fools than fools fromthe wise." quote[49]="The heart of a fool is in his mouth, but the mouthof a wise man is in his heart." quote[50]="The poor man is not he whois without a cent, but he who is without a dream." function rndnumber(){var randscript = -1 while (randscript < 0 || randscript > howMany || isNaN(randscript)){randscript = parseInt(Math.random()*(howMany+1)) } return randscript } quo = rndnumber()quox = quote[quo] document.write(quox) // End script--> </script> </CENTER> 

第二部分

<scriptLANGUAGE="Javascript"> <!-- Distributed by http://www.hypergurl.comBegin function calc() { first = document.loveform.name1.value.toUpperCase(); firstlength= document.loveform.name1.value.length; second = document.loveform.name2.value.toUpperCase();secondlength = document.loveform.name2.value.length; var LoveCount=0; for (Count=0;Count < firstlength; Count++) { letter1=first.substring(Count,Count+1); if(letter1=='L') LoveCount+=2; if (letter1=='O') LoveCount+=2; if (letter1=='V')LoveCount+=2; if (letter1=='E') LoveCount+=2; if (letter1=='Y') LoveCount+=3;if (letter1=='O') LoveCount+=1; if (letter1=='U') LoveCount+=3; } for (Count=0;Count < secondlength; Count++) { letter2=second.substring(Count,Count+1); if(letter2=='L') LoveCount+=2; if (letter2=='O') LoveCount+=2; if (letter2=='V')LoveCount+=2; if (letter2=='E') LoveCount+=2; if (letter2=='Y') LoveCount+=3;if (letter2=='O') LoveCount+=1; if (letter2=='U') LoveCount+=3; } amount=0; if(LoveCount> 0) amount= 5-((firstlength+secondlength)/2) if (LoveCount> 2)amount= 10-((firstlength+secondlength)/2) if (LoveCount> 4) amount= 20-((firstlength+secondlength)/2)if (LoveCount> 6) amount= 30-((firstlength+secondlength)/2) if (LoveCount>8) amount= 40-((firstlength+secondlength)/2) if (LoveCount>10) amount= 50-((firstlength+secondlength)/2)if (LoveCount>12) amount= 60-((firstlength+secondlength)/2) if (LoveCount>14)amount= 70-((firstlength+secondlength)/2) if (LoveCount>16) amount= 80-((firstlength+secondlength)/2)if (LoveCount>18) amount= 90-((firstlength+secondlength)/2) if (LoveCount>20)amount=100-((firstlength+secondlength)/2) if (LoveCount>22) amount=110-((firstlength+secondlength)/2)if (firstlength==0 || secondlength==0) amount= "Err"; if (amount <0) amount= 0; if (amount >99) amount=99; document.loveform.output.value=amount+"%";} // End --> </script><form name=loveform> <inputvalue="Bill Clinton" name="name1" type="text" size="20">+ <input value="Monica Lewinsky" name="name2" type="text"size="20"> = <input value="" name="output"type="text" size="6"> <br> <br> <input value="Calculate!"name="calculate" type="button" value="calculate"onclick="calc()"> </form>

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.