一些随机数生成,想知道我是否可以使用循环来生成所有这些数字,而不是写出所有整数。还有比这更好的方法吗?我可以把它保持原样吗?
public static int rx1 = 0+(int)(Math.random()*760);
public static int ry1 = 0+(int)(Math.random()*555);
public static int rx2 = 0+(int)(Math.random()*760);
public static int ry2 = 0+(int)(Math.random()*555);
public static int rx3 = 0+(int)(Math.random()*760);
public static int ry3 = 0+(int)(Math.random()*555);
public static int rx4 = 0+(int)(Math.random()*760);
public static int ry4 = 0+(int)(Math.random()*555);
public static int rx5 = 0+(int)(Math.random()*760);
public static int ry5 = 0+(int)(Math.random()*555);
public static int rx6 = 0+(int)(Math.random()*760);
public static int ry6 = 0+(int)(Math.random()*555);
public static int rx7 = 0+(int)(Math.random()*760);
public static int ry7 = 0+(int)(Math.random()*555);
public static int rx8 = 0+(int)(Math.random()*760);
public static int ry8 = 0+(int)(Math.random()*555);
public static int rx9 = 0+(int)(Math.random()*760);
public static int ry9 = 0+(int)(Math.random()*555);
public static int rx10 = 0+(int)(Math.random()*760);
public static int ry10 = 0+(int)(Math.random()*555);
public static int rx11 = 0+(int)(Math.random()*760);
public static int ry11 = 0+(int)(Math.random()*555);
public static int rx12 = 0+(int)(Math.random()*760);
public static int ry12 = 0+(int)(Math.random()*555);
public static int ry13 = 0+(int)(Math.random()*555);
public static int rx13 = 0+(int)(Math.random()*760);
public static int rx14 = 0+(int)(Math.random()*555);
public static int ry14 = 0+(int)(Math.random()*555);
public static int rx15 = 0+(int)(Math.random()*760);
public static int ry15 = 0+(int)(Math.random()*555);
public static int rx16 = 0+(int)(Math.random()*760);
public static int ry16 = 0+(int)(Math.random()*555);
public static int rx17 = 0+(int)(Math.random()*760);
public static int ry17 = 0+(int)(Math.random()*555);
public static int rx18 = 0+(int)(Math.random()*760);
public static int ry18 = 0+(int)(Math.random()*555);
public static int rx19 = 0+(int)(Math.random()*760);
public static int ry19 = 0+(int)(Math.random()*555);
public static int rx20 = 0+(int)(Math.random()*760);
public static int ry21 = 0+(int)(Math.random()*555);
public static int rx21 = 0+(int)(Math.random()*760);
public static int ry22 = 0+(int)(Math.random()*555);
public static int rx22 = 0+(int)(Math.random()*760);
public static int ry23 = 0+(int)(Math.random()*555);
public static int rx23 = 0+(int)(Math.random()*760);
public static int ry24 = 0+(int)(Math.random()*555);
public static int rx24 = 0+(int)(Math.random()*760);
public static int ry25 = 0+(int)(Math.random()*555);
public static int rx25 = 0+(int)(Math.random()*760);
public static int ry26 = 0+(int)(Math.random()*555);
public static int rx27 = 0+(int)(Math.random()*760);
public static int ry28 = 0+(int)(Math.random()*555);
public static int rx28 = 0+(int)(Math.random()*760);
public static int ry29 = 0+(int)(Math.random()*555);
public static int ry30 = 0+(int)(Math.random()*555);
public static int rx30 = 0+(int)(Math.random()*760);
public static int rx31 = 0+(int)(Math.random()*555);
public static int ry31 = 0+(int)(Math.random()*555);
public static int rx32 = 0+(int)(Math.random()*760);
public static int ry32 = 0+(int)(Math.random()*555);