So, I'm debugging a bit of code that should work, but my computer hates me. What am I doing wrong?
In my main() function, I've got the simplest of loops:
Then, a bit further along, I've got the offending function:
for(int z = 0; z < nGenerations; z++)
ParseData(nGridWidth, nGridHeight, dScore, gridInfo);
Here's the problem: The first time the function ParseData() is called, everything seems to be working fine. I get a set of (pseudo)random numbers that are good enough for my purposes. However, every subsequent call to the function gives me the same sequence of numbers. I could call the thing 10,000 times, and still get the same results. What's up with that?
int ParseData(int nGridWidth, int nGridHeight, double dScore, vector <vector <sGrid> >& gridInfo)
for(int j = 0; j < rand() % 25 + 1; j++)
for(int i = 0; i < nGridWidth / 2; i++)
nCrossPoint = rand() % nNumGenes;
cout << nCrossPoint << endl;