|
|

楼主 |
发表于 2012-3-6 09:15:08
|
显示全部楼层
代码帖的有点乱,怎么都没人能帮忙看看呢?
3 n, b4 o# {, O: A public void spreadmoney(int m){
2 F7 _: \9 @& J' C: U4 m; o4 I; Q for(int i=0;i<m;i++){
% P! j! P: N C# r" b int x = (int)(Math.random()*(moneyspace.getSizeX()));* M0 S0 j* `- K u0 }# f8 m
int y = (int)(Math.random()*(moneyspace.getSizeY()));
G5 V3 G; e7 |5 x$ t5 X( k
+ p3 H1 I. }0 M int I; _$ A! L- }( N
if(moneyspace.getObjectAt(x,y)!=null
1 `! \, p, Z" `/ { I = ((Integer)moneyspace.getObjectAt(x,y)).intValue();6 Z. [9 W, W/ n7 E+ Z( h: i
}
W+ k4 C( p) U3 S2 [ else{$ e* `$ a, W2 i9 U8 J# y
I = 0;) F F# h- j* X7 z( o+ a$ H6 M
}
: V7 q D3 H8 r9 z. c3 Z; J moneyspace.putObjectAt(x, y, new Integer(I+1)); }
' ~& U) O. D t. ^) K } |
|