アットウィキロゴ

どこも

var card=new Array();
var rank=new Array();
var number;
var pi=new Array();
 
function sample(){
 
faststep();
 
 
select();    
 
paintx();    
 
}
 
function paintx(){
 
 
 
 
str="<table>";    
for(s=1;s<14;s++){
str=str+"<tr>";
str=str+"<td>";
sx=rank[s];
str=str+card[sx];    
str=str+"</td>";     
str=str+"<td>";
sx=rank[s];    
str=str+card[sx];    
str=str+"</td>"; 
str=str+"<td>";
sx=rank[s];    
str=str+card[sx];    
str=str+"</td>";  
str=str+"<td>";
sx=rank[s];    
str=str+card[sx];    
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月19日 02:51