HADANIE CISEL

ID
Nazov / Name:
Popis / Description:
Dlzka / Length:
Testovane pod / Tested under:

 

096
p096.html / p096.zip
Hra hadanie cisel
611b
NN 4.04, IE 4.0

UKAZKA / CLICK HERE

Zdrojovy tvar / Source code:

<HTML> <HEAD> <TITLE> JavaScript DESTINATION - P096 </TITLE> </HEAD> <BODY> <SCRIPT LANGUAGE="JavaScript"> <!-- function hadaj(){ var a=Math.round(Math.random()*100) var h=window.prompt("Hadaj cislo: (pokus 1)",""); for (var i=1; i<10; i++) { if (h==a) { window.alert("Vyhral si na "+i+" pokus"); return; } if (h>a) var h=window.prompt("Menej! (pokus "+(i+1)+")","") if (h<a) var h=window.prompt("Viac! (pokus "+(i+1)+")","") if (i==9) {window.alert("Prehral si!"); return;} } } hadaj(); // --> </SCRIPT> <br> <center><h2><a href="p096.html">Nova hra</a></h2> </BODY> </HTML>
[ Navrat / BACK ]