Simple GIS

GISプログラムの練習

人生ゲーム

package life;


public class pro {

    int point=new int[101]; 
int x,y;
int mx,my;    
int t,n,mode;    
int s;
    public static void main(String args) {
        pro test=new pro();
    }
pro(){

    
    mx=100;
    my=100;
    
    for(s=1;s<100;s++){
    n=s/10;
    point[s]=s-10*n;
    }
    
    x=0;
    y=0;
    mode=0;
    while(mode==0){
    x=x+rourete();
    y=y+rourete();
    if(x<100)mx=mx-point[x];
    if(y<100)my=my-point[y];
    check();
    System.out.println(x+","+y+","+mx+","+my);
    }
    
}
void check(){
if(x>99)mode=100;
if(y>99)mode=200;    
if(mx<0)mode=200;
if(my<0)mode=100;   
}
int rourete(){
int n;
 n=(int)(10*Math.random())+1;
    
return n;    
}
}