|
|

楼主 |
发表于 2012-3-6 09:15:08
|
显示全部楼层
代码帖的有点乱,怎么都没人能帮忙看看呢?
& d1 w$ ^1 j( j, L public void spreadmoney(int m){
! V2 l4 z/ H/ @ for(int i=0;i<m;i++){2 Q" W5 `8 {; y9 A6 v6 U) \
int x = (int)(Math.random()*(moneyspace.getSizeX()));
N L9 b4 H$ o, D* { int y = (int)(Math.random()*(moneyspace.getSizeY()));
, G( `% b' B1 p7 _
f* i8 R/ P- @8 U! ? int I;
D G( T) ?% u3 x# F if(moneyspace.getObjectAt(x,y)!=null # | G5 Z% m9 h' z6 j
I = ((Integer)moneyspace.getObjectAt(x,y)).intValue(); W2 S$ b: r4 s3 v G8 j# c8 x" k
}6 l% P, H) r+ |& S8 c4 N& v
else{6 Z) i( E; y2 R
I = 0;
. N- S) E# A6 D. Z% h }
( J/ m& k% h7 ^" f2 Y+ L' ~ moneyspace.putObjectAt(x, y, new Integer(I+1)); }
6 d+ }3 ^! c$ }- u5 F5 E) o2 p } |
|