var x=new Array();
var y=new Array();
var point,pointx;
function sample(){
tx=0;
for(s=1;s<4;s++){
for(sx=1;sx<14;sx++){
tx=tx+1;
x[tx]=s;
}
}
point=0;
pointx=0;
var timer;
var delay = 100;
var loop = function () {
for(s=1;s<1000;s++){
select();
h=0;
d=y[1];
if(x[d]==2)h=h+1;
d=y[2];
if(x[d]==2)h=h+1;
d=y[3];
if(x[d]==2)h=h+1;
d=y[4];
if(x[d]==2)h=h+1;
if(h==4)point=point+1;
h=0;
d=y[2];
if(x[d]==2)h=h+1;
d=y[3];
if(x[d]==2)h=h+1;
d=y[4];
if(x[d]==2)h=h+1;
if(h==3)pointx=pointx+1;
}
z=0;
if(pointx>0)z=100*point/pointx;
k=100*10/49;
$("#memo").html(z+","+k);
clearTimeout(timer);
timer = setTimeout(loop, delay);
}
loop();
}
function select(){
var ch=new Array();
var z=new Array();
var s,sx;
for(s=1;s<53;s++){
ch[s]=0;
}
n1=52*Math.random();
m1=Math.floor(n1)+1;
ch[m1]=100;
sx=0;
for(s=1;s<53;s++){
if(ch[s]<50)sx=sx+1;
if(ch[s]<50)z[sx]=s;
}
n1=51*Math.random();
m2=Math.floor(n1)+1;
m2=z[m2];
ch[m2]=100;
sx=0;
for(s=1;s<53;s++){
if(ch[s]<50)sx=sx+1;
if(ch[s]<50)z[sx]=s;
}
n1=50*Math.random();
m3=Math.floor(n1)+1;
m3=z[m3];
ch[m3]=100;
sx=0;
for(s=1;s<53;s++){
if(ch[s]<50)sx=sx+1;
if(ch[s]<50)z[sx]=s;
}
n1=49*Math.random();
m4=Math.floor(n1)+1;
m4=z[m4];
y[1]=m1;
y[2]=m2;
y[3]=m3;
y[4]=m4;
}
最終更新:2016年04月25日 07:07