Handbook
Glossary
randomize ( seq -- randomized )
Generating random integers
Prev:
Random protocol
Next:
sample ( seq n -- seq' )
Vocabulary
random
Inputs
seq
a
sequence
Outputs
randomized
a
sequence
Word description
Randomizes a sequence in-place with the Fisher-Yates algorithm and returns the sequence.
Definition
USING:
kernel
sequences
;
IN:
random
:
randomize
( seq -- randomized )
dup
length
randomize-n-last
;