<SCRIPT LANGUAGE="JavaScript">
<!--
count=0; // 回転する数字
randam=0; // 問題の数
function hajime() { // はじめ(数字の回転開始)
count=count+1;
document.form1.text1.value = count;
timer=setTimeout("hajime()", 10);
}
function tomare() { // とまれ(数字の回転ストップ&メッセージ表示)
clearTimeout(timer);
if(count==randam){
document.form1.text0.value = randam+" で止めてね …… ぱーふぇくとっ!!";}
if(count>randam){
if(count>=randam+15){
document.form1.text0.value = randam+" で止めてね …… 遅すぎだよ!";}
else document.form1.text0.value = randam+" で止めてね …… ちょい遅いっ!";}
if(count<randam){
if(count<=randam-15){
document.form1.text0.value = randam+" で止めてね …… 速すぎだよ!";}
else document.form1.text0.value = randam+" で止めてね …… ちょい速いっ!";}
}
function yari() { // やりなおし(リセット)
count=0;
document.form1.text1.value = count;
}
function mondai() { // もんだい(リセット&ランダム問題作成)
count=0;
document.form1.text1.value = count;
randam=Math.ceil(Math.random() * 300);
document.form1.text0.value = randam+" で止めてね";
}
// -->
</SCRIPT>
|