|
|

楼主 |
发表于 2012-3-6 09:15:08
|
显示全部楼层
代码帖的有点乱,怎么都没人能帮忙看看呢?
: J) I3 A4 B$ U6 i* u3 z9 ] public void spreadmoney(int m){
, ]! }# U, c, E1 g6 G7 s } for(int i=0;i<m;i++){
0 O, \* T' v0 P' `% ?( D5 p# E4 a int x = (int)(Math.random()*(moneyspace.getSizeX()));) H$ z# P k$ Q9 T/ B
int y = (int)(Math.random()*(moneyspace.getSizeY()));2 ^- [6 l1 H5 c* c! @0 G
' U% J; {" W/ _ int I;( t! |+ \. f$ q3 D( U) X
if(moneyspace.getObjectAt(x,y)!=null 2 E! s F G1 a9 ~" s6 W( d/ f
I = ((Integer)moneyspace.getObjectAt(x,y)).intValue();
4 q# e; z7 e' K2 z0 [$ T( G& F }* a, z3 F8 Y( N! M0 w: N# f
else{
$ c1 H+ q ^# b1 ?: b% d0 B* W# p I = 0;
! x, n* n% h7 H5 c( |7 q }6 a. t& v+ F( j% [5 X
moneyspace.putObjectAt(x, y, new Integer(I+1)); } f- D r, k( ^' v I" a9 C1 B
} |
|