ID:138643
 
Is there an easy way to pick a random member of a list? I have a feeling there is one and I've just forgotten it. But I can't find anything.

By the way, the DM infocenter misrepresents how to use probabilities in pick()... it states "A value for P of 2 makes it twice as likely as the norm, 0.5 half as likely, and so on." Where, in my experience, a value of 200 is twice the norm. Er, meaning the norm is 100, not 1.

Z
On 4/10/00 8:49 pm Zilal wrote:
Is there an easy way to pick a random member of a list? I have a feeling there is one and I've just forgotten it. But I can't find anything.

Sure. How about:
var/randval = mylist[rand(1,mylist.len)]

By the way, the DM infocenter misrepresents how to use probabilities in pick()... it states "A value for P of 2 makes it twice as likely as the norm, 0.5 half as likely, and so on." Where, in my experience, a value of 200 is twice the norm. Er, meaning the norm is 100, not 1.

Okie dokey .. will fix.