|
|

楼主 |
发表于 2012-3-6 09:15:08
|
显示全部楼层
代码帖的有点乱,怎么都没人能帮忙看看呢?
% S: F3 O9 S; { a+ j G2 D. E" M, q public void spreadmoney(int m){ O& E1 @# b8 Z9 K
for(int i=0;i<m;i++){% N/ M* g" E0 |3 v
int x = (int)(Math.random()*(moneyspace.getSizeX()));3 ^$ O4 f3 B+ k. w/ A8 R1 O# W8 ^
int y = (int)(Math.random()*(moneyspace.getSizeY()));
# Y3 x/ L8 e. K' q' [
% n# i& V0 T2 }4 E int I;
% i" W7 x. }6 v if(moneyspace.getObjectAt(x,y)!=null ' A' x* B3 f+ l
I = ((Integer)moneyspace.getObjectAt(x,y)).intValue();
% C) R1 L) u9 c! A& ^ }
% A1 n$ {3 a3 W+ }: p* g% J8 u6 V else{
8 `8 J- F* F7 }1 t, |; h2 |" ~& i I = 0;
+ @/ Q! {. A9 A& j3 t }
1 z& i$ p. f, J2 {4 U5 d moneyspace.putObjectAt(x, y, new Integer(I+1)); }! s# R3 g7 _" u9 I
} |
|