Content deleted Content added
suggest setting flag so random seed is set once during a single module invocation |
→Setting random seed: reply |
||
Line 1:
==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. [[User:Isaacl|isaacl]] ([[User talk:Isaacl|talk]]) 17:39, 30 November 2013 (UTC)
:Actually, sometimes generating the same number is necessary, as some wikicode assumes that {{tl|rand}} generates the same number every time it is called on the same page. (This can now be done with the {{para|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. — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪ talk ♪]]</sup> 07:26, 2 December 2013 (UTC)
|