|
|

楼主 |
发表于 2012-3-6 09:15:08
|
显示全部楼层
代码帖的有点乱,怎么都没人能帮忙看看呢?
" \2 }6 j3 z S public void spreadmoney(int m){
: B! F0 i4 `$ e d for(int i=0;i<m;i++){
! ]4 \1 X) a* g4 q9 a6 _ int x = (int)(Math.random()*(moneyspace.getSizeX()));8 a; R) j$ U: ~; Q
int y = (int)(Math.random()*(moneyspace.getSizeY()));
, A" B5 `7 o3 j) H+ s! c( A
# Z9 o0 |2 n- v7 ? int I;# j3 u2 x' R$ J
if(moneyspace.getObjectAt(x,y)!=null S, i. [, \( P+ w7 h" V
I = ((Integer)moneyspace.getObjectAt(x,y)).intValue();* |8 [/ m. n4 q) `- Q; Y! s# b N
}
" c* S& U- T4 t: r& o& a* ?8 o else{
0 o- E. y9 j& P2 f I = 0;% X0 |8 W V6 h5 Z3 v
}
1 h9 |" b- `0 ~- z, v- J moneyspace.putObjectAt(x, y, new Integer(I+1)); }
1 U7 C) C+ A# V4 r ^: J } |
|