random-lines ( n -- lines )


Vocabulary
io.random

Inputs
nan object


Outputs
linesan object


Definition


:: random-lines ( n -- lines )
V{ } clone :> accum [| line line# |
line# n <=
[ line accum push ] [
line# random :> r r n <
[ line r accum set-nth-unsafe ] when
] if
] each-numbered-line accum ;