|
|

楼主 |
发表于 2012-3-6 09:15:08
|
显示全部楼层
代码帖的有点乱,怎么都没人能帮忙看看呢?
. x& R$ R( a4 E V0 m public void spreadmoney(int m){
2 P/ z: V( x; e2 @# n7 E for(int i=0;i<m;i++){3 Q9 j, ^ B& L, Y' p7 B
int x = (int)(Math.random()*(moneyspace.getSizeX()));
+ s+ i& P) N4 v$ f7 ?5 [& B# T int y = (int)(Math.random()*(moneyspace.getSizeY()));/ I4 l6 k! A% N# u
8 E7 Z4 ^ |1 r0 u; m( _
int I;! `) Z: }0 l s. l" u
if(moneyspace.getObjectAt(x,y)!=null F/ y" m$ r B+ x
I = ((Integer)moneyspace.getObjectAt(x,y)).intValue();
) Q: f, s% g' A0 a+ Z0 J/ O& [2 ] }
) [3 Q4 c4 D: D% a9 V! M else{: i9 f9 h/ D5 h
I = 0;
( m6 f/ X, T% e) X: [, U- B. g }; R8 P0 y; _3 l5 g3 g( M
moneyspace.putObjectAt(x, y, new Integer(I+1)); }7 a2 W7 b3 n$ E% b/ w: W4 S" L
} |
|