|

楼主 |
发表于 2012-3-6 09:15:08
|
显示全部楼层
代码帖的有点乱,怎么都没人能帮忙看看呢? 0 ]: ^* [; ?/ I1 ~
public void spreadmoney(int m){" w* v( `4 X: l' M5 i, y
for(int i=0;i<m;i++){
; w* O3 R+ }1 R, |7 e" Y7 t2 | int x = (int)(Math.random()*(moneyspace.getSizeX()));' R4 d4 T8 f4 ^- [+ n: I
int y = (int)(Math.random()*(moneyspace.getSizeY()));5 j/ m9 |0 n2 a" U
, ?) Q3 w6 P D2 z U& b2 R* _ int I;% m4 H' m- K" f, W& r2 v. F( f4 l
if(moneyspace.getObjectAt(x,y)!=null
- z9 Z/ B8 n" F" @# _1 _0 t: } I = ((Integer)moneyspace.getObjectAt(x,y)).intValue();
3 b* w9 |5 v: A9 M( N3 G, p+ u }
. U# I" j- W$ T% x0 a: F! k else{
7 R0 E) x3 L, Y, g I = 0;
. B; I4 B3 c7 E- @# L+ S6 {6 b( e }
* n6 r8 _+ T9 Z- d+ W. y" h moneyspace.putObjectAt(x, y, new Integer(I+1)); }
2 E$ j4 U* t+ {2 L& D } |
|