This may seem dumb, but I'm a newbie both at game programming and at programming in general.
To create stats for my game my program generates a string of random numbers (about 7 of them) all at once by calling the function RANDOM. The code looks like this:
int RANDOM (int factor)
{
srand ((unsigned)time (NULL));
int rawNum = rand() % factor;
int num = rawNum + 1;
return num;
}
Problem is, with my 1.2 GHz Athlon, all the numbers get generated
within one second i.e. the seed for generating the numbers is constant. Is there any way to rectify this?