3 ms·
In some cases, yes. Some simulations want to have the same sequence of numbers. Seems like a fundamental design misunderstanding in nethack, however.
by wglb 12y ago
In some cases, yes.
Some simulations want to have the same sequence of numbers. Seems like a fundamental design misunderstanding in nethack, however.
- detrino 12y ago> Some simulations want to have the same sequence of numbers. srand(time(NULL)); does not provide that.
- jerf 12y agoThe point is, if you want a repeatable sequence, ask for it. If you want a truly random sequence, ask for it. What you don't want is a repeatable random sequence that you, the programmer, incorrectly think is truly random. But rather a lot of invocations to srand turn out to be this case, rather than either of the legitimate two.