Fixed random_int and random_real functions; added random_boolean.

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
This commit is contained in:
twanvl
2008-08-24 16:08:13 +00:00
parent 6d45dc8a26
commit c8fb341e1a
9 changed files with 107 additions and 49 deletions
+22
View File
@@ -0,0 +1,22 @@
Function: random_boolean
DOC_MSE_VERSION: since 0.3.8
--Usage--
> random_boolean(probability)
Returns a random [[type:bool]], either @true@ or @false.
The parameter is the probability of returning @true@, so @random_boolean(0.0)@ always returns @true@, @random_boolean(1.0)@ always returns @false@ and @random_boolean(0.5)@ simulates a fair coin toss.
Since the result is random, calling the function twice will give a different answer.
--Parameters--
! Parameter Type Default Description
| @input@ [[type:double]] @0.5@ Probability of returining true
--Examples--
> random_boolean(0.5) == true
> random_boolean(0.5) == false
--See also--
| [[fun:random_real]] Generate a random [[type:double]].