
Credits: javascriptkit.com
mod, bila nggak berguna, tutup thread ini..
ini cara membuat game tebak nomor dengan javascript
seperti thread milik ymm0t

taro kode di bawah di bagian C
[spoiler]//TEBAK NOMOR
var guessme=Math.round(Math.random()*(99)+1);
var speech='tebak nomorku (dari 1 to 100)';
function process(mystery) {
var guess=document.forms.guessquiz.guess.value;
var speech='"'+guess+ '" tulis angka, bukan huruf.';
document.forms.guessquiz.guess.value='';
if (guess==mystery)
{
document.forms.guessquiz.prompt.value='Selamat! '+mystery+' benar!';
alert ('Benar, angkanya adalah '+mystery+'! tekan lagi tombol reloadnya.');
speech='';
document.location=document.location;
}
if (mystery<guess)
{
speech='lebih kecil dari '+ guess;
}
if (mystery>guess)
{
speech='lebih besar dari '+ guess;
}
if (guess=='')
{
speech='You didn\'t guess anything!'
}
document.forms.guessquiz.prompt.value=speech; document.forms.guessquiz.guess.focus();
}
[/spoiler]

taro kode di bawah di about me, atau jadi addbox.
[spoiler]<FORM onSubmit="" NAME="guessquiz">
<CENTER>
<TABLE ALIGN="CENTER" BGCOLOR="#888888" BORDER="3" CELLPADDING="5">
<TR>
<TD BGCOLOR="#ff0033">
<FONT COLOR="#ffffff" FACE="Arial"><B>tebak nomorku (1 - 100)</B></FONT>
</TD>
</TR>
<TR>
<TD>
<CENTER>
<INPUT TYPE="text" NAME="prompt" SIZE="31" MAXLENGTH="40" VALUE="tebak dulu nomorku (dari 1 to 100)"><BR>
<INPUT TYPE="text" NAME="guess" SIZE="3" MAXLENGTH="3" VALUE="">
<INPUT TYPE="button" VALUE="
Tebak" onClick='process(guessme)'>
</CENTER>
</TD>
</TR>
</TABLE>
</CENTER>
</FORM>
[/spoiler]
kalau mau jadi addbox, klik [url=http://h1.ripway.com/qqzq07/addboxgen.html]ini[/url]
Preview: [url]http://qqgunners.fileave.com/a.html[/url]