
Keith B. answered 09/08/19
Software Engineer and Math Geek
You actually don't need to call rand() more than once, if you can generate a good starting seed. Lot's of good science in computer science has been put into creating random numbers, as computers are not very good at it. (Google Donald Knuth and "The Art of Computer Programming") Most random number generators use a large table, and when you call srand() to initialize your random numbers, it is picking a location in that table. If you provide srand() with the same number, you get the same sequence of random numbers each call.
Most programs, to get around this, seed srand() with the current time, usually the time when the program start. I know a guy who broke the Keno games at a Casino in Atlantic City, because someone told him what time the machine was turned on. My company's software used the time, but we reset srand() every time a human touched a button that requested the ball draw -- human interaction is something truly random, as you could not know in advance the exact time they would press the button, and by the time you found out, the draw was already done.
That said, try creating your own Random() class, and have the constructor seed srand() at instantiation. Add additional calls to srand() at infrequent (ie, random) times that your program requests a random number.