Rev 7692 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
20 | reyssat | 1 | !if $wims_read_parm!=slib_header |
13588 | bpr | 2 | !goto proc |
20 | reyssat | 3 | !endif |
4158 | bpr | 4 | |
20 | reyssat | 5 | slib_parms=3\ |
6 | ,n\ |
||
7 | n,m\ |
||
8 | n,k |
||
4351 | bpr | 9 | slib_author=Gang, XIAO |
4158 | bpr | 10 | slib_example= 10,7,2 |
20 | reyssat | 11 | !exit |
12 | |||
13 | :proc |
||
14 | !distribute items $wims_read_parm into slib_n,slib_m,slib_k |
||
15 | !bound slib_n between integer 1 and 100 default 0 |
||
16 | !bound slib_m between integer 1 and $slib_n default $slib_n |
||
17 | !bound slib_k between integer 1 and $slib_n default $slib_n |
||
18 | !if $slib_n=0 |
||
13588 | bpr | 19 | !reset slib_out |
20 | !exit |
||
20 | reyssat | 21 | !endif |
22 | slib_sh=!shuffle $slib_n-1 |
||
23 | slib_sh=!item 1 to $slib_m-1 of $slib_sh |
||
24 | slib_sh2=$slib_k |
||
25 | !for slib_i=1 to $slib_m-1 |
||
13588 | bpr | 26 | slib_l=!item $slib_i of $slib_sh |
27 | !if $slib_l>=$slib_k |
||
28 | !advance slib_l |
||
29 | !endif |
||
30 | slib_sh2=$slib_sh2,$slib_l |
||
20 | reyssat | 31 | !next slib_i |
32 | |||
33 | slib_out=!shuffle $slib_sh2 |