アットウィキロゴ

p5p

var x=new Array();
var y=new Array();
 
function sample(){
 
 
x[1]=40;
x[2]=162;
x[3]=-8;
x[4]=64;
 
y[1]=40;
y[2]=0;
y[3]=-8;
y[4]=0;
 
 
x1=op();
 
y1=select(x1);
 
$("#memo").html(x1+","+y1);
 
 
 
}
function op(){
 
n1=select(1);
m1=f(1,n1);
x1=x[m1];
 
 
n2=select(2);
m2=f(2,n2);
x2=x[m2];
 
 
var sxs;
sxs=1;
if(x2>x1)sxs=2;       
return sxs;    
} 
 
 
function select(s1){
 
m1=f(s1,1);
y1=y[m1];    
 
m2=f(s1,2);
y2=y[m2];     
 
var sx;    
sx=1;
if(y2>y1)sx=2;    
 
return sx;    
}
 
 
 
function f(x1,y1){
 
sx=0;
 
h=0;
if(x1==1)h=h+1;
if(y1==1)h=h+1;
if(h==2)sx=1;
 
h=0;
if(x1==1)h=h+1;
if(y1==2)h=h+1;
if(h==2)sx=2;
 
 
h=0;
if(x1==2)h=h+1;
if(y1==1)h=h+1;
if(h==2)sx=3;
 
h=0;
if(x1==2)h=h+1;
if(y1==2)h=h+1;
if(h==2)sx=4;
 
return sx;
}
最終更新:2016年06月23日 08:14