cleanup for easier debugging
This commit is contained in:
@@ -46,9 +46,12 @@ RandomGen::RandomGen( unsigned long seed_ )
|
||||
seed = time(NULL);
|
||||
}
|
||||
|
||||
int RandomGen::operator() ( int maximum )
|
||||
int RandomGen::operator() ( int n )
|
||||
{
|
||||
return int(RandomFloat( seed ) * maximum);
|
||||
float f = RandomFloat(seed) * (n);
|
||||
int ans = int(f);
|
||||
CLAMP( ans, 0, n-1 );
|
||||
return ans;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -183,7 +183,7 @@ class RandomGen
|
||||
|
||||
public:
|
||||
RandomGen( unsigned long seed = 0 );
|
||||
int operator() ( int maximum = INT_MAX-1 );
|
||||
int operator() ( int n = INT_MAX-1 ); // return number [0,n)
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user