|

楼主 |
发表于 2012-3-6 09:15:08
|
显示全部楼层
代码帖的有点乱,怎么都没人能帮忙看看呢? Q6 A5 `# r' \* [( G/ A6 h
public void spreadmoney(int m){
4 e# H8 F# `4 a9 @ for(int i=0;i<m;i++){
! B- I% Z: _+ I# Q/ I) s int x = (int)(Math.random()*(moneyspace.getSizeX()));+ @, m& I* V/ `1 B0 @
int y = (int)(Math.random()*(moneyspace.getSizeY()));+ \/ Q+ |4 j5 X% S8 |( H# k
' V6 c% H3 Y7 ^1 \
int I;
( C. O- u7 E' u$ h1 n if(moneyspace.getObjectAt(x,y)!=null
1 D0 g Y3 [ u$ K! Z! L I = ((Integer)moneyspace.getObjectAt(x,y)).intValue();, q, M b2 | I4 c
}# K. b4 f/ C, g
else{5 U% D" b4 g# l8 X# j
I = 0;
/ r& P% q+ t8 S N* F }
6 M/ F5 o% `* h" f( {& \ moneyspace.putObjectAt(x, y, new Integer(I+1)); }
* o, o( u0 r$ H( ^( } Z } |
|