View Single Post
Old Feb 6th, 2007, 6:29 PM   #7
programmingnoob
Hobbyist Programmer
 
Join Date: Feb 2006
Posts: 155
Rep Power: 3 programmingnoob is on a distinguished road
Quote:
Originally Posted by programmingnoob View Post
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
programmingnoob is offline   Reply With Quote