!! +var+ +random+ +string+
$lst_tit shuffle$lst_titend$type_var
$lst_alias randperm, randpermute<br>
$
(lst_syntax
)shuffle [even
|odd
] $emph n
$emphend</tt
>, or
<br
>
$lst_mean Randomly permutes a set of $emph n $emphend elements. $emph n
$emphend must be a positive integer not greater than 1024 in the first
usage
, or is the number of items in
$emph list $emphend in the second
usage. <br>
For the first usage, the command
returns a comma
-separated
list $emph i
<sub
>1</sub
>, i
<sub
>2</sub
>, ...,
i<sub>n</sub>$emphend, where the items $emph i<sub>k</sub>$emphend are
randomly ordered elements of the set $emph {1,2,...,n}$emphend. <br>
This command can be used in conjunction with commands
$(ref1)cmdlist_item_&+cmd_choose=all$(ref2)cmdlist_item_">!item</a>,
$(ref1)cmdlist_line_&+cmd_choose=all$(ref2)cmdlist_line_">!line</a>,
$(ref1)cmdlist_word_&+cmd_choose=all$(ref2)cmdlist_word_">!word</a>,
$(ref1)cmdlist_char_&+cmd_choose=all$(ref2)cmdlist_char_">!char</a>,
to randomly permute items, lines, words, or characters in a string. <br>
For the second usage
, a
new list with randomly permuted items in
$emph list $emphend is returned
. <br
>
In any case, the variable $emph wims_shuffle_order $emphend is set to be
the
list $emph i
<sub
>1</sub
>, i
<sub
>2</sub
>, ...,
i<sub>n</sub>$emphend. <br>
When the optional word $emph even$emphend or
$emph odd$emphend is present, only even/odd permutations are produced.