Évszámra megmutatja milyen állat vagy:
<script LANGUAGE="JavaScript"> <!--
/* Submitted by David Gardner (davidgardner7@yahoo.com) Featured on JavaScript Kit (http://javascriptkit.com) For this and over 400+ free scripts, visit http://javascriptkit.com */
function getpet () {
var toyear = 1997; var birthyear = document.frm.inyear.value; var birthpet="Ox"
x = (toyear - birthyear) % 12 if ((x == 1) || (x == -11)) { birthpet="Mouse" } else { if (x == 0) { birthpet="Ox" } else { if ((x == 11) || (x == -1)) { birthpet="Tiger" } else { if ((x == 10) || (x == -2)) { birthpet="Rabbit" } else { if ((x == 9) || (x == -3)) { birthpet="Dragon" } else { if ((x == 8) || (x == -4)) { birthpet="Snake" } else { if ((x == 7) || (x == -5)) { birthpet="Horse" } else { if ((x == 6) || (x == -6)) { birthpet="Sheep" } else { if ((x == 5) || (x == -7)) { birthpet="Monkey" } else { if ((x == 4) || (x == -8)) { birthpet="Chicken" } else { if ((x == 3) || (x == -9)) { birthpet="Dog" } else { if ((x == 2) || (x == -10)) { birthpet="Pig" } } } } } } } } } } } } document.frm.birth.value = birthpet;
} // --> </script>
<p>Enter your birth year. For example: "1975" </p> <form NAME="frm"> <p><input TYPE="text" SIZE="4" NAME="inyear" value="1975"> <input TYPE="button" VALUE="My pet, please" onClick="getpet()"> <br> </p> <p><input TYPE="text" SIZE="9" NAME="birth"> </font></p> </form>
<p align="center"><font face="arial" size="-2">This free script provided by</font><br> <font face="arial, helvetica" size="-2"><a href="http://javascriptkit.com">JavaScript Kit</a></font></p>
KÉTSZEMÉLYES AMÖBA:
<center> <SCRIPT name = "JavaScript"> function variables(){ t = 1; change = 1; empty1 = -1; empty2 = -1; empty3 = -1; empty4 = -1; empty5 = -1; empty6 = -1; empty7 = -1; empty8 = -1; empty9 = -1; return; whogoesnow = "Tour joueur 1" }
function win(){ if (empty1==empty2 && empty2==empty3 && empty3==0 || empty4==empty5 && empty5==empty6 && empty6==0 || empty7==empty8 && empty8==empty9 && empty9==0 || empty1==empty4 && empty4==empty7 && empty7==0 || empty2==empty5 && empty5==empty8 && empty8==0 || empty3==empty6 && empty6==empty9 && empty9==0 || empty1==empty5 && empty5==empty9 && empty9==0 || empty3==empty5 && empty5==empty7 && empty7==0 ){ alert ("Joueur 1: VOUS GAGNEZ !!!"); history.go(0) } if (empty1==empty2 && empty2==empty3 && empty3==1 || empty4==empty5 && empty5==empty6 && empty6==1 || empty7==empty8 && empty8==empty9 && empty9==1 || empty1==empty4 && empty4==empty7 && empty7==1 || empty2==empty5 && empty5==empty8 && empty8==1 || empty3==empty6 && empty6==empty9 && empty9==1 || empty1==empty5 && empty5==empty9 && empty9==1 || empty3==empty5 && empty5==empty7 && empty7==1 ){ alert ("Joueur 2: VOUS GAGNEZ !!!"); history.go(0) } }
function turnchange(t){ if (change == 1) { if (t == 0){ t = 1; whogoesnow = "Tour : Joueur " + 1 } else { t = 0; whogoesnow = "Tour : Joueur " + 2 } } else { t = t; } change = 1 return (t); }
function changing(clicked){ if (clicked == 1){ spot = empty1 ;} if (clicked == 2){ spot = empty2 ;} if (clicked == 3){ spot = empty3 ;} if (clicked == 4){ spot = empty4 ;} if (clicked == 5){ spot = empty5 ;} if (clicked == 6){ spot = empty6 ;} if (clicked == 7){ spot = empty7 ;} if (clicked == 8){ spot = empty8 ;} if (clicked == 9){ spot = empty9 ;}
if (spot == -1){ if (t == 0){ xo = " O " ; spot = 0 } else { xo = " X " ; spot = 1 } if (clicked == 1){ empty1 = spot;} if (clicked == 2){ empty2 = spot ;} if (clicked == 3){ empty3 = spot ;} if (clicked == 4){ empty4 = spot ;} if (clicked == 5){ empty5 = spot ;} if (clicked == 6){ empty6 = spot ;} if (clicked == 7){ empty7 = spot ;} if (clicked == 8){ empty8 = spot ;} if (clicked == 9){ empty9 = spot ;} } else { if (spot == 0){ xo = " O ";} if (spot == 1){ xo = " X ";} change = 0 } return (xo) ; }
function change_b1(form){ clicked = 1; changing(clicked) ; t = turnchange(t) ; form.b1.value = xo; form.whoseturn.value = whogoesnow win(); return; } function change_b2(form){ clicked = 2; changing(clicked) ; form.b2.value = xo; t = turnchange(t) ; form.whoseturn.value = whogoesnow win(); return; }
function change_b3(form){ clicked = 3; changing(clicked) ; form.b3.value = xo; t = turnchange(t) ; form.whoseturn.value = whogoesnow win(); return; }
function change_b4(form){ clicked = 4; changing(clicked) ; form.b4.value = xo; t = turnchange(t) ; form.whoseturn.value = whogoesnow win(); return; }
function change_b5(form){ clicked = 5; changing(clicked) ; form.b5.value = xo; t = turnchange(t) ; form.whoseturn.value = whogoesnow win(); return; }
function change_b6(form){ clicked = 6; changing(clicked) ; form.b6.value = xo; t = turnchange(t) ; form.whoseturn.value = whogoesnow win(); return; }
function change_b7(form){ clicked = 7; changing(clicked) ; form.b7.value = xo; t = turnchange(t) ; form.whoseturn.value = whogoesnow win(); return; }
function change_b8(form){ clicked = 8; changing(clicked) ; form.b8.value = xo; t = turnchange(t) ; form.whoseturn.value = whogoesnow win(); return; }
function change_b9(form){ clicked = 9; changing(clicked) ; form.b9.value = xo; t = turnchange(t) ; form.whoseturn.value = whogoesnow win(); return; } </SCRIPT>
<SCRIPT name = "JavaScript"> variables(); </SCRIPT>
<FORM> <input type = "button" name = "whoseturn" value = "Tour: Joueur 1"> <br><br><br><br> <table> <tr><td><input type = "button" name = "b1" value = " " onClick = change_b1(this.form)> <td><input type = "button" name = "b2" value = " " onClick = change_b2(this.form)> <td><input type = "button" name = "b3" value = " " onClick = change_b3(this.form)> <tr><td><input type = "button" name = "b4" value = " " onClick = change_b4(this.form)> <td><input type = "button" name = "b5" value = " " onClick = change_b5(this.form)> <td><input type = "button" name = "b6" value = " " onClick = change_b6(this.form)> <tr><td><input type = "button" name = "b7" value = " " onClick = change_b7(this.form)> <td><input type = "button" name = "b8" value = " " onClick = change_b8(this.form)> <td><input type = "button" name = "b9" value = " " onClick = change_b9(this.form)> </table> <br><br>
<INPUT TYPE="button" VALUE="Nouvelle Partie" onClick="history.go(0)"> </center>
Mi a kedvenc számod?
<SCRIPT LANGUAGE="JavaScript"> <!-- ; // numberguess is by Lancer - written 4 Jan 1999 // lancer@kp.planet.gen.nz
var guessme=Math.round(Math.random()*(99)+1); var speech='Guess my number (from 1 to 100)';
function process(mystery) { var guess=document.forms.guessquiz.guess.value; var speech='"'+guess+ '" does not make sense to me.'; document.forms.guessquiz.guess.value='';
if (guess==mystery) { document.forms.guessquiz.prompt.value='Congratulations! '+mystery+' is correct!'; alert ('Well done - the mystery number is '+mystery+'! \n\nPress this button to reload the page for another game.'); speech=''; document.location=document.location; }
if (mystery<guess) { speech='Less than '+ guess; }
if (mystery>guess) { speech='Greater than '+ guess; }
if (guess=='') { speech='You didn\'t guess anything!' }
document.forms.guessquiz.prompt.value=speech; document.forms.guessquiz.guess.focus();
}
// end hide --> </SCRIPT>
<FORM onSubmit="" NAME="guessquiz"> <CENTER> <TABLE ALIGN="CENTER" BGCOLOR="#888888" BORDER="3" CELLPADDING="5"> <TR> <TD BGCOLOR="#004080"> <FONT COLOR="#ffffff" FACE="Arial"><B>GUESS MY NUMBER (1 - 100)</B></FONT> </TD> </TR> <TR> <TD> <CENTER> <INPUT TYPE="text" NAME="prompt" SIZE="31" MAXLENGTH="40" VALUE="Guess my number (from 1 to 100)"><BR> <INPUT TYPE="text" NAME="guess" SIZE="3" MAXLENGTH="3" VALUE=""> <INPUT TYPE="button" VALUE="Guess" onClick='process(guessme)'> </CENTER> </TD> </TR> </TABLE> </CENTER> </FORM> |