Re: srand() aberration ??? -
20-06-2004
Because you HAVE to call srand() at least once if you intend to use rand()... else each time you run the program you'll have the same series of numbers.
rand() is based on a math suite. Not sure its the real word. It's just like the math quizs for children : given the number you have, and the number before, and the number before it, deduce the number that's going to come right after. rand() is just that. If you don't initialize the seed (that is, the initial number of the suite) the output values will always be the same.
hrm, I should go to bed. sorry. 8am here.
RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
|