Rev 5921 | Rev 11212 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5921 | Rev 11210 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | !! +var+ +random+ +string+ |
1 | !! +var+ +random+ +string+ |
2 | 2 | ||
- | 3 | tit:shuffle |
|
3 |
|
4 | type:$type_var |
4 |
|
5 | alias:!randperm, !randpermute |
5 |
|
6 | syntax:!shuffle [even|odd] `n', or<br/>\ |
6 |
|
7 | <span class="tt">!shuffle [even|odd] `list'</span> |
7 |
|
8 | mean:Randomly permutes a set of `n' elements. `n' must be a positive integer \ |
8 | $emphend must be a positive integer not greater than 1024 in the first |
- | |
9 | usage, |
9 | not greater than 1024 in the first usage, or is the number of items in `list' in the second\ |
10 | usage |
10 | usage. <br/>\ |
11 | For the first usage, the command |
- | |
12 | returns a comma |
11 | For the first usage, the command returns a comma-separated list `i<sub>1</sub>, i<sub>2</sub>, ...,\ |
13 | i |
12 | i<sub>n</sub>', where the items `i<sub>k</sub>' are\ |
14 | randomly ordered elements of the set |
13 | randomly ordered elements of the set `{1,2,...,n}'. <br/>\ |
15 | This command can be used in conjunction with |
14 | This command can be used in conjunction with commands\ |
16 | $(ref1)cmdlist_item_&+cmd_choose=all$(ref2)cmdlist_item_">!item</a>, |
15 | $(ref1)cmdlist_item_&+cmd_choose=all$(ref2)cmdlist_item_">!item</a>,\ |
17 |
|
16 | $(ref1)cmdlist_line_&+cmd_choose=all$(ref2)cmdlist_line_">!line</a>,\ |
18 | $(ref1)cmdlist_word_&+cmd_choose=all$(ref2)cmdlist_word_">!word</a>, |
17 | $(ref1)cmdlist_word_&+cmd_choose=all$(ref2)cmdlist_word_">!word</a>,\ |
19 |
|
18 | $(ref1)cmdlist_char_&+cmd_choose=all$(ref2)cmdlist_char_">!char</a>,\ |
20 | to randomly permute items, lines, words, or characters in a string. <br/> |
19 | to randomly permute items, lines, words, or characters in a string. <br/>\ |
21 | For the second usage, a new list with randomly permuted items in |
20 | For the second usage, a new list with randomly permuted items in `list' is returned. <br/>\ |
22 | $emph list $emphend is returned. <br/> |
- | |
23 | In any |
21 | In any case, the variable `wims_shuffle_order' is set to be\ |
24 | the list |
22 | the list `i<sub>1</sub>, i<sub>2</sub>, ..., i<sub>n</sub>'. <br/>\ |
25 | i<sub>n</sub>$emphend. <br/> |
- | |
26 | When the optional word $emph even$emphend or |
- | |
27 |
|
23 | When the optional word `even' or `odd' is present, only even/odd permutations are produced. |
28 | - |