Thread Tools Display Modes
Prev Previous Post   Next Post Next
06-06-13, 12:33 AM   #1
gmarco
An Onyxian Warder
 
gmarco's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 362
random()

Hi all,

Is possible that the function:

random(1,n)

called with a short delay (let's say 1.5 sec) one from each other will return several time in a row the same value (es y). And this is more visible if "n" is not so much far from 1 so that the numbers to randomize are few.

es. of output I mean (1..4) : 2,2,2,2,2,3

Is possible to add some more entropy to this function or rewrite it in other way (es. scaling the number to something larger ?) to get something like:

1,4,3,3,2,4,1 etc etc ...


Thanks for attention.
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » random()


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off