Yeah i know rand as a random number generator sucks. It really, really does but i'm not looking for true random numbers just something give's me something appears random.
Have this rather convulated code.
for (int i=0; i<5; i++)
{
AI.ptype= agents.agentPersonality();
}
which leads to
int agent::agentPersonality() {
personalityType=emote.eStates();
happiness=emote.emotionPass.happiness;
sadness=emote.emotionPass.sadness;
anger=emote.emotionPass.anger;
fear=emote.emotionPass.fear;
surprise=emote.emotionPass.surprise;
disgust=emote.emotionPass.disgust;
return personalityType;
}
when then leads to
int emotions::eStates() {
switch (Type.MBTI())
{
case 1: //ISTJ
emotionPass.happiness=0.05;
emotionPass.sadness=0.04;
emotionPass.anger=0.05;
emotionPass.fear=0.04;
emotionPass.surprise=0.02;
emotionPass.disgust=0.03;
return Type.MBTI();
break;
.
.
.
and finally from there to here
int personality::MBTI() {
srand ( time(NULL) );
EI = rand()%2;
SN = rand()%2;
TF = rand()%2;
JP = rand()%2;
<code that creats type here>
return type;
So as we see it's jumps from one class to the next and at the end gives me the exact same number for for loops. I tried incresing the time but it's still rather poor. I'm looking for anything that'll just give me 5 "random" numbers, don't care about true random, and preferably I'd rather not use some kind of sleep function.
Any help would be appreciated ^^