アットウィキロゴ

やきゅういう

var inn,out,point_home,point_visit;
var base=new Array();
var point;
 
function sample(){
 
point_home=0;
point_visit=0;
 
 
for(inn=1;inn<10;inn++){
visit();
home();
}
 
alert(point_home+","+point_visit);
 
 
}
function home(){
 
 
game();    
 
 
 
point_home=point_home+point;    
}
 
function visit(){
 
game();    
 
point_visit=point_visit+point;    
 
}
 
 
function game(){
 
point=0;
out=0;
for(s=1;s<4;s++){
base[s]=0;    
}
 
while(out<3){
play();    
}
 
} 
 
function play(){
 
hit=0;    
if(Math.random()>0.5)hit=100;    
if(hit>50)delta();
if(hit<50)out=out+1;
 
 
} 
 
function delta(){
 
 
 
if(base[3]==1)point=point+1;    
if(base[3]==1)base[3]=0;
if(base[2]==1)base[3]=1;
if(base[2]==1)base[2]=0;
if(base[1]==1)base[2]=1;
base[1]=1;
 
}
 
最終更新:2015年06月29日 12:59