make-permutation-generator
vectorReturns a generator that yields random permutations of vector.
(generator->list (make-permutation-generator '(1 2 3)) 3) ⇒ ((1 2 3) (2 3 1) (3 2 1)) (generator->list (make-permutation-generator "abc") 3) ⇒ ("cba" "cba" "cab") |
make-combination-generator
size vectorReturns a generator that yields vectors of size elements randomly picked from vector.
(generator->list (make-combination-generatorh 2 #(a b c)) 5) ⇒ (#(a c) #(a b) #(a c) #(b a) #(a c)) (generator->list (make-combination-generator 2 '#(a b c)) 5) ⇒ (#(a c) #(b c) #(c b) #(b a) #(b c)) |