アットウィキロゴ

gyaku

package th6;
 
 
public class pro {
 
  int[] path=new int[101];
  int[] number_c=new int[10];
  int[] number_y=new int[10];
  int s,c1,y1;  
  double v1;
  int b1;
  double[] u=new double[101];
  double[] b=new double[101];
   double[][] vs=new double[101][11];
 
 
    public static void main(String[] args) {
       pro test=new pro();
    }
 
pro(){    
 
     for(s=1;s<101;s++){
   for(b1=-5;b1<6;b1++){
   vs[s][b1+5]=-999;  
   }
}
 
    makenumber();
 
    int tr;
 
    for(tr=1;tr<100000;tr++){
 
    path();
 
    v1=0;
    b1=0;
    for(s=1;s<101;s++){
    c1=getc(path[s]);
    y1=gety(path[s]);
    u[s]=0;
    v1=v1+u[s];
    b1=b1+y1-c1;
    }
 
    double v2;
    int b2,z;
 
 
 
    for(s=1;s<101;s++){
    v2=v1-u[s];
    c1=getc(path[s]);
    y1=gety(path[s]);
    b2=b1-y1+c1;  
    z=0;
    if(b2>5)z=100;
    if(b2<-5)z=100;
    if(z>50)b2=0;
    if(z>60)v2=-999;
    if(v2>vs[s][b2+5])vs[s][b2+5]=v2;
    }
 
    }
 
 
 
 
 
 
 
 
}  
void makenumber(){
int s,sx;
int tx;
tx=0;
for(s=-1;s<2;s++){
for(sx=-1;sx<2;sx++){   
tx=tx+1;
number_c[tx]=s;
number_y[tx]=sx;
}
}
 
 
}
int gety(int s){
int s1;    
s1=number_y[s];    
return s1;    
}
int getc(int s){
    int s1;
 
s1=number_c[s];    
return s1;    
}
void path(){ 
 
int n,s;
 
for(s=1;s<101;s++){
n=(int)(9*Math.random())+1; 
path[s]=n;
}
 
}   
}
 
最終更新:2014年03月24日 15:54