|
|

楼主 |
发表于 2012-3-6 09:15:08
|
显示全部楼层
代码帖的有点乱,怎么都没人能帮忙看看呢?
, F5 y3 ?' s1 Q6 D, b( U public void spreadmoney(int m){
* x- _: T9 _, X2 r for(int i=0;i<m;i++){+ b) M# a0 h* Q9 h4 \, W
int x = (int)(Math.random()*(moneyspace.getSizeX()));
: i2 u; h9 T' Q5 d int y = (int)(Math.random()*(moneyspace.getSizeY()));, V; i5 T S( M3 K- A
' l6 t- y( `+ D% V& ]
int I;
$ a9 f& w3 m6 I& g( p( H if(moneyspace.getObjectAt(x,y)!=null
, _+ o s- x3 o& F$ A' D I = ((Integer)moneyspace.getObjectAt(x,y)).intValue();% l4 v+ ^# u) D G; T+ v- N. E( ]. S
}
+ x8 \+ R3 h2 `3 @" e3 g9 {) H else{9 R2 t6 \( K3 q: Z& M
I = 0;
; n3 C Y$ h) ?- ~ }; e/ I5 b0 ?+ `( ~0 o2 \4 d5 E( a
moneyspace.putObjectAt(x, y, new Integer(I+1)); }9 Z& c' t+ u' V% m/ A
} |
|