Quote:
Originally Posted by programmingnoob
oh btw I tried
[HTML]srand(getpid());
int choice = rand() % 2; // random integer - 0 and 1
[/HTML]
the problem will this is it will ALWAYS alternate LOL
lol i want something that will alternate sometimes, sometimes it wont ... something like that
|
i know why it always alternates ....
because I called srand function inside the while loop
i called it outside the while loop and now it gives pretty random results
thanks folks