mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
c8fb341e1a
Split random_select into random_select and random_select_many. git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1161 0fc631ac-6414-0410-93d0-97cfa31319b6
23 lines
585 B
Plaintext
23 lines
585 B
Plaintext
Function: random_select
|
|
|
|
DOC_MSE_VERSION: since 0.3.7
|
|
|
|
--Usage--
|
|
> random_select(some_list, count: some_number, replace: some_boolean)
|
|
|
|
Randomly select an items from a list.
|
|
|
|
Since the result is random, calling the function twice will give a different answer.
|
|
|
|
--Parameters--
|
|
! Parameter Type Description
|
|
| @input@ [[type:list]] List to shuffle.
|
|
|
|
--Examples--
|
|
> random_select([1,2,3,4]) == 4
|
|
> random_select([1,2,3,4]) == 2
|
|
|
|
--See also--
|
|
| [[fun:random_select_many]] Pick multiple random elements from a list.
|
|
| [[fun:random_shuffle]] Randomly shuffle a list.
|