|
|

楼主 |
发表于 2012-3-6 09:15:08
|
显示全部楼层
代码帖的有点乱,怎么都没人能帮忙看看呢?
% S' |6 w" V* @8 L3 y8 B% p public void spreadmoney(int m){( l9 S& K$ y: U
for(int i=0;i<m;i++){- w) H& |: h2 {
int x = (int)(Math.random()*(moneyspace.getSizeX()));
% E7 q$ V# \3 R* J" I- F int y = (int)(Math.random()*(moneyspace.getSizeY()));+ a( q1 y5 h4 `) g
/ \$ w/ U& A& { int I;
; e. k4 n5 ^8 k, {! {* ]5 x) g6 a if(moneyspace.getObjectAt(x,y)!=null
0 t5 ~! z* N3 n% Q I = ((Integer)moneyspace.getObjectAt(x,y)).intValue();
1 d; G1 V& @5 w' q( F* K, s }
+ `" _' m3 p) D1 Q; c else{$ k! _' T5 E1 w2 F$ |$ g. X
I = 0;
8 j9 c& f/ c: i4 M }
6 x1 r' N& W1 S9 @3 r4 [ moneyspace.putObjectAt(x, y, new Integer(I+1)); }
; }) o4 J4 D0 S! ^ } |
|