//Generate Food Personality
for(i=0; i<food.size(); i++)
{
srand(time(0));
int randomFood = rand() % 6;
if(randomFood == 1 || randomFood == 3 || randomFood == 5)
{
badFood.push_back(food[randomFood]);
}
else if(randomFood == 0 || randomFood == 2 || randomFood == 4)
{
goodFood.push_back(food[randomFood]);
}
}
cout << "Size of Food Vector: " << food.size() << endl;
cout << "Size of Bad Food: " << badFood.size() << endl;
cout << "Size of Good Food " << goodFood.size() << endl;
randomFood is a random number through 6 and it takes the random number in food[] and adds it to a vector depending on how the random number turns out.
My problem is it seems that its always generating an odd or even number. and the bad and good.size() always prints out as 6 or 0, never anything else.