aliasmask wrote:
Not terribly efficient with large starting numbers, but does the same thing and preserves the range in the code. Your function would be better. Other languages usually don't have such a function either but does provide random and seed functions unlike MT. For example, rand would be a number between 0 and 1. Seed would restarted the random number with the seed value so you could get the same random numbers all things being equal.
indeed. never new that existed and indeed not very efficient, but since its directly calculated in java instead of going through the parser first, it might certainly be more efficient for low numbers. Using that in 'randBetween instead' would probly look like:
Code: Select all
[h:macro.return = eval(strformat("1d%sr%s",arg(1), arg(5)))]
which is doubtfully more efficient.
So If we would request something, would it be seed(), rand() and/or randbetween() or none of these as the interest is too low...? TBH everytime I look at
[roll:] im surprised how it works. I expect it to be roll(low, high) but its roll(times, diceType) and I *do* recall having a need for a randBetween function one time or another and I probly solved it on the fly (like above). In all, especially when you're a *game* supporting system, you would expect some core randomizers...