random ( obj -- elt ) - Factor Documentation

random ( obj -- elt )
Generating random integers



Vocabulary
random

Inputs
obj an object


Outputs
elt a random element


Word description
Outputs a random element of the input object, or outputs f if the object contains no elements.

Examples
USING: random prettyprint ; 10 random .
3

USING: random prettyprint ; SYMBOL: heads SYMBOL: tails { heads tails } random .
heads


See also
random* , randoms , randoms-as

Definition
USING: namespaces ;

IN: random

: random ( obj -- elt ) random-generator get random* ;

AltStyle によって変換されたページ (->オリジナル) /