Don't click here unless you want to be banned.

LSL Wiki : llListRandomize

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl338.us.archive.org
list llListRandomize(list src, integer stride)

Returns src randomized into blocks of size stride.

If stride is less then one it is treated as 1.



Example:
// This shuffles each list item around.
list foo = ["LSL", "is", "teh", "sucks"];
list bar = llListRandomize(foo, 1);
llSay(0, llList2CSV(bar));
// This might make the object say "is, LSL, sucks, teh" or "LSL, sucks, 
// teh, is" or any of the other 22 combinations of possible lists.

// This breaks the list up into two blocks and moves them around.
list foo = ["LSL", "is", "teh", "sucks"];
list bar = llListRandomize(foo, 2);
llSay(0, llList2CSV(bar));
// This might make the object say "LSL, is, teh, sucks" or "teh, sucks, LSL, is",
// but nothing else would be possible.

// This does nothing.
list foo = ["LSL", "is", "teh", "sucks"];
list bar = llListRandomize(foo, 4);
llSay(0, llList2CSV(bar));
// Object says "LSL, is, teh, sucks"

For most purposes, setting stride to 1 is probably what you want. This will just randomize all the items in the list.

Compare with llListSort.


This article wasn't helpful for you? Maybe the related article at the LSL Portal is able to bring enlightenment.

Lists | Functions
There are 8 comments on this page. [Display comments/form]