var card=new Array();
var rank=new Array();
var number;
var pi=new Array();
function sample(){
faststep();
select();
paintx();
}
function paintx(){
var x1=new Array();
var x2=new Array();
var x3=new Array();
var x4=new Array();
sx=0;
for(s=1;s<number+1;s++){
if(pi[s]==1)sx=sx+1;
if(pi[s]==1)x1[sx]=card[s];
}
sx=0;
sx=0;
for(s=1;s<number+1;s++){
if(pi[s]==2)sx=sx+1;
if(pi[s]==2)x2[sx]=card[s];
}
sx=0;
for(s=1;s<number+1;s++){
if(pi[s]==3)sx=sx+1;
if(pi[s]==3)x3[sx]=card[s];
}
sx=0;
for(s=1;s<number+1;s++){
if(pi[s]==4)sx=sx+1;
if(pi[s]==4)x4[sx]=card[s];
}
str="<table>";
for(s=1;s<14;s++){
str=str+"<tr>";
str=str+"<td>";
str=str+x1[s];
str=str+"</td>";
str=str+"<td>";
str=str+x2[s];
str=str+"</td>";
str=str+"<td>";
str=str+x3[s];
str=str+"</td>";
str=str+"<td>";
str=str+x4[s];
str=str+"</td>";
str=str+"</tr>";
}
str=str+"</table>";
$("#memo").html(str);
}
function select(){
var point=new Array();
var ch=new Array();
for(s=1;s<number+1;s++){
point[s]=Math.random();
}
for(r=1;r<number+1;r++){
ch[r]=0;
}
for(r=1;r<number+1;r++){
maxp=0;
sx=0;
for(s=1;s<number+1;s++){
h=0;
if(point[s]>maxp)h=h+1;
if(ch[s]<50)h=h+1;
if(h==2)sx=s;
if(h==2)maxp=point[s];
}
rank[r]=sx;
ch[sx]=100;
}
for(s=1;s<number+1;s++){
pi[s]=0;
}
for(s=1;s<14;s++){
sx=rank[s];
pi[sx]=1;
}
for(s=14;s<27;s++){
sx=rank[s];
pi[sx]=2;
}
for(s=27;s<40;s++){
sx=rank[s];
pi[sx]=3;
}
for(s=40;s<53;s++){
sx=rank[s];
pi[sx]=4;
}
}
function faststep(){
tx=0;
for(s=1;s<10;s++){
for(sx=1;sx<5;sx++){
tx=tx+1;
card[tx]=""+s+"万";
}}
for(s=1;s<10;s++){
for(sx=1;sx<5;sx++){
tx=tx+1;
card[tx]=""+s+"筒";
}}
for(s=1;s<10;s++){
for(sx=1;sx<5;sx++){
tx=tx+1;
card[tx]=""+s+"索";
}}
for(sx=1;sx<5;sx++){
tx=tx+1;
card[tx]="東";
}
for(sx=1;sx<5;sx++){
tx=tx+1;
card[tx]="南";
}
for(sx=1;sx<5;sx++){
tx=tx+1;
card[tx]="西";
}
for(sx=1;sx<5;sx++){
tx=tx+1;
card[tx]="北";
}
for(sx=1;sx<5;sx++){
tx=tx+1;
card[tx]="発";
}
for(sx=1;sx<5;sx++){
tx=tx+1;
card[tx]="白";
}
for(sx=1;sx<5;sx++){
tx=tx+1;
card[tx]="中";
}
number=tx;
}
最終更新:2015年04月20日 14:59