Module talk:Random
Appearance
Setting random seed
I suggest setting a flag when the random seed is set, so it can be set just once. I know it won't help with multiple invocations of the module, since the flag won't be preserved, but at least when random numbers are being generated multiple times during a given function call, the risk of repeating the same seed value will be eliminated. isaacl (talk) 17:39, 30 November 2013 (UTC)
- Actually, sometimes generating the same number is necessary, as some wikicode assumes that {{rand}} generates the same number every time it is called on the same page. (This can now be done with the
|same=
parameter.) But I think you do have a point - it was messy code to call setRandomSeed so many times. I've reworked the module so that it is only called once. — Mr. Stradivarius ♪ talk ♪ 07:26, 2 December 2013 (UTC)