|
|

楼主 |
发表于 2012-3-6 09:15:08
|
显示全部楼层
代码帖的有点乱,怎么都没人能帮忙看看呢?
4 u1 s# T8 {2 w5 P- j" o3 _ public void spreadmoney(int m){1 X+ B0 ]# ?, ?
for(int i=0;i<m;i++){; l, L+ O8 }) O7 B0 w5 `: z0 o0 m
int x = (int)(Math.random()*(moneyspace.getSizeX()));& E! y. T7 t7 z) r* D5 Z/ {5 u: e
int y = (int)(Math.random()*(moneyspace.getSizeY()));5 p' [3 _4 A$ ]" _5 x; J
3 z. D* L$ O7 }" |' t3 p
int I;# F- C5 r: v7 G
if(moneyspace.getObjectAt(x,y)!=null
- s- e% C) B4 x. X9 E1 ` I = ((Integer)moneyspace.getObjectAt(x,y)).intValue();: P, [1 Q$ R \3 }' z+ t
}
" g% U+ T' {0 `! z3 o5 B else{
Y- X) e- N. Q8 M4 n/ m I = 0;
9 J6 n& |; i; q' D* N9 d& A }$ G0 O+ e. t- [: [
moneyspace.putObjectAt(x, y, new Integer(I+1)); }1 a. I$ u2 q9 S( G
} |
|