|
|

楼主 |
发表于 2012-3-6 09:15:08
|
显示全部楼层
代码帖的有点乱,怎么都没人能帮忙看看呢?
( d0 n7 y& L7 w* [ public void spreadmoney(int m){
4 a* ]& S* k0 i. c for(int i=0;i<m;i++){& a0 y) a, y0 }' H/ r
int x = (int)(Math.random()*(moneyspace.getSizeX()));1 a/ T# {. i. F' @
int y = (int)(Math.random()*(moneyspace.getSizeY()));% t0 `6 t* i" G3 ]& b
- d& s) c9 Q5 T" p( G, S2 F; E
int I;. O2 h$ Q$ z$ v
if(moneyspace.getObjectAt(x,y)!=null
1 E% b6 R( p. c" x+ Q I = ((Integer)moneyspace.getObjectAt(x,y)).intValue();& d9 b, [" x e1 ~( b' ~
}
) G9 q( ?; M+ {% c else{
k7 r% G6 r, m; e# I3 h- Y/ _: @' D I = 0;* C8 C8 G" {0 G5 J
}
1 c( u; s5 V# ]& K5 X moneyspace.putObjectAt(x, y, new Integer(I+1)); }
( H, X. ^5 e' J } |
|