|
|

楼主 |
发表于 2012-3-6 09:15:08
|
显示全部楼层
代码帖的有点乱,怎么都没人能帮忙看看呢?
2 m: `& f$ o" P: ~$ j1 I public void spreadmoney(int m){
+ e* _5 Y! z" f8 h* O" O5 g4 B: q for(int i=0;i<m;i++){! A9 }" Z* S6 Z9 {9 x4 J
int x = (int)(Math.random()*(moneyspace.getSizeX()));
: A: \0 `1 X) y- M" I+ E4 u int y = (int)(Math.random()*(moneyspace.getSizeY()));
! J8 D& K9 Y2 ?
+ Y+ I4 B& t1 }% n9 t9 c int I;. D; }' y j) _: A" p- }
if(moneyspace.getObjectAt(x,y)!=null 8 A' L% r* r, T- B9 c' C9 h! P
I = ((Integer)moneyspace.getObjectAt(x,y)).intValue();
5 C5 [# Y( F$ v* z i& d% [& K }- D5 d0 O+ \ p0 V0 B
else{4 T9 r' K" |. {4 V" D a+ a
I = 0;, k( V- H2 s w& P
}" @$ @$ n# ~. Y2 @. n! \4 f
moneyspace.putObjectAt(x, y, new Integer(I+1)); }
/ f! H* E9 J8 a5 |0 f } |
|