|
|

楼主 |
发表于 2012-3-6 09:15:08
|
显示全部楼层
代码帖的有点乱,怎么都没人能帮忙看看呢?
2 U: p1 B5 c0 W( E) a public void spreadmoney(int m){
: g* t4 b7 v" q& o for(int i=0;i<m;i++){9 q) F# d l: \1 u. j) S
int x = (int)(Math.random()*(moneyspace.getSizeX()));3 V( R6 s6 w' a; w0 a% q0 {+ G, r
int y = (int)(Math.random()*(moneyspace.getSizeY()));* z* c/ g% q7 T* F' z5 m0 e" g
" q( e; W1 W- `5 h, V
int I;
- l9 I" x3 {2 k) e$ ]: k% | r& U if(moneyspace.getObjectAt(x,y)!=null
2 z$ x1 ^. Y: G0 o I = ((Integer)moneyspace.getObjectAt(x,y)).intValue();% c9 u, \; r; f+ l
}0 E, e! s. c2 B" w% u
else{3 C9 X: e% y+ Z8 U
I = 0;+ r% A/ ~( R5 [
}
) D, } v% C# t( J' ~ moneyspace.putObjectAt(x, y, new Integer(I+1)); }
+ x( Y1 [! V+ J" c } |
|