<HTML>
<HEAD>
<SCRIPT TYPE="text/javascript">
<!--
var i, t, n, rNumber, num, num1, num2, num3;
var t=100;//最初の速さ

movmg=new Array();
for (i=0; i<10; i++){
  movimg[i] = new Image();
  movimg[i].src = "image/number/num"+i+".gif";
}

function getNumber(){
  if(navigator.appVersion.charAt(0)>=3){
    Randoms(9); num1 = rNumber; document.Image1.src=movimg[num1].src
    Randoms(9); num2 = rNumber; document.Image2.src=movimg[num2].src
    Randoms(9); num3 = rNumber; document.Image3.src=movimg[num3].src
    if(num1 == num2 || num2 == num3 || num1 == num3){ getNumber(); }
  }
}

function slot(n){
  if(navigator.appVersion.charAt(0)>=3){
    t = document.SLOT.SPEED.value;
    if(n == 1){
      document.Image1.src=movimg[num1].src;
      num1++; if(num1 == 10){ num1 = 0; }
      st1 = setTimeout("slot(1)",t); }
    else if(n == 2){ 
      document.Image2.src=movimg[num2].src;
      num2++; if(num2 == 10){ num2 = 0; }
      st2 = setTimeout("slot(2)",t); }
    else if(n == 3){
      document.Image3.src=movimg[num3].src;
      num3++; if(num3 == 10){ num3 = 0; }
      st3 = setTimeout("slot(3)",t); }
  }
}

function stop(st){
  if(navigator.appVersion.charAt(0)>=3){
    clearTimeout(st);
      if(num1 == num2 && num2 == num3){
        window.alert("Perfect!"); }
  }
}

function Randoms(r){
    iValue = Math.random() * r;
    rNumber = Math.ceil(iValue);
}

//-->
</SCRIPT>
</HEAD>
<BODY onLoad="getNumber()">
<FORM NAME="SLOT">
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0">
    <TR>
      <TD BGCOLOR="#000000" ALIGN="CENTER" NOWRAP>
        <IMG SRC="../image/cage/number/num_b0.gif" WIDTH="20" HEIGHT="30" HSPACE="10" VSPACE="20" NAME="Image1"></TD>
      <TD BGCOLOR="#000000" ALIGN="CENTER" NOWRAP>
        <IMG SRC="../image/cage/number/num_b0.gif" WIDTH="20" HEIGHT="30" HSPACE="10" VSPACE="20" NAME="Image2"></TD>
      <TD BGCOLOR="#000000" ALIGN="CENTER" NOWRAP>
        <IMG SRC="../image/cage/number/num_b0.gif" WIDTH="20" HEIGHT="30" HSPACE="10" VSPACE="20" NAME="Image3"></TD>
    </TR>
    <TR>
      <TD BGCOLOR="#000000" ALIGN="CENTER" NOWRAP>
        <INPUT TYPE="BUTTON" VALUE="STOP" NAME="button1" onClick="stop(st1)">
      </TD>
      <TD BGCOLOR="#000000" ALIGN="CENTER" NOWRAP>
        <INPUT TYPE="BUTTON" NAME="button2" VALUE="STOP" onClick="stop(st2)">
      </TD>
      <TD BGCOLOR="#000000" ALIGN="CENTER" NOWRAP>
        <INPUT TYPE="BUTTON" NAME="button3" VALUE="STOP" onClick="stop(st3)">
      </TD>
    </TR>
    <TR ALIGN="CENTER">
    <TD COLSPAN="5">
        <SELECT NAME="SPEED">
          <OPTION VALUE="100">SPEED</OPTION>
          <OPTION VALUE="50">Hi</OPTION>
          <OPTION VALUE="100">Middle</OPTION>
          <OPTION VALUE="300">Low</OPTION>
        </SELECT>
      <INPUT TYPE="BUTTON" VALUE="START!" onClick="slot(1);slot(2);slot(3)">
    </TD>
  </TR>
</TABLE>
</FORM>
</BODY>
</HTML>

BACK