Handbook
Glossary
randomize-n-last ( seq n -- seq )
Vocabulary
random
Inputs
seq
an
object
n
an
object
Outputs
seq
an
object
Definition
USING:
kernel
math
math.order
namespaces
sequences
sequences.private
;
IN:
random
:
randomize-n-last
( seq n -- seq )
[
dup
length
dup
]
dip
-
1
max
[
[
dup
]
]
dip
[
>
]
curry
compose
random-generator
get
[
random*
]
curry
[
[
1
-
]
bi
[
pick
exchange-unsafe
]
keep
]
curry
while
drop
;