cleanup for easier debugging

This commit is contained in:
Chris Danford
2006-03-28 19:15:44 +00:00
parent 1a240d3b6c
commit f9d50da5e1
2 changed files with 6 additions and 3 deletions
+5 -2
View File
@@ -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;
}
+1 -1
View File
@@ -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)
};