class
pro{
public static void main(String[] args){
int x,y;
int dx,dy;
int mode,t;
x=40;
y=70;
mode=0;
t=0;
while(mode<
100){
dx=1;
if (Math.random()>0.5)dx=-1;
x=x+dx;
if (x<10)x=10;
dy=1;
if (Math.random()>0.5)dy=-1;
y=y+dy;
if (y>90)y=90;
if (y<x+5)y=x+5;
t=t+1;
if (t>100)mode=200;
}
System.out.println("time over");
}
}
最終更新:2010年10月04日 17:19