public void random() {
int temp;
boolean flag = true;
a[0] = (int)(Math.random() * 320);
for (int i = 1; i < 320; i++) {;
if (flag) {
temp = (int)(Math.random() * a[i - 1]);
a[i] = temp + (int)(Math.random() * (a[i - 1] - temp));
flag = false;
} else {
temp = (int) (Math.random() * (320 - a[i - 1]));
a[i] = a[i - 1] + (int) (Math.random() * (temp - a[i - 1]));
flag = true;
}
}
test
最新推荐文章于 2023-07-20 17:00:10 发布