setting a random seed
For this project I''m using VS .NET 2002 and I''ve landed on that srand() only has effect when called once per program instance. That is: if you were to call srand(time(NULL)) at the top of your program, any further calls to srand(MY_CONSTANT) will not generate a recurring output by rand(). Naturally, that''s a damn shame... The alternative, of course, is to use a custom-written random number generator, which I''m not prepared to do.
it works correctly on my compiler (BCC55)...
you could try the "mersenne twister" (google for it) if you don''t want to work out your own random number algorithm.
you could try the "mersenne twister" (google for it) if you don''t want to work out your own random number algorithm.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement