Quantcast
Channel: Active questions tagged ocaml - Stack Overflow
Viewing all articles
Browse latest Browse all 531

Generate a random permutation of the elements of a list OCaml

$
0
0

i whant generate a random permutation of elements of a list,Example:

listString =  ["a"; "b"; "c"; "d"; "e"; "f"]

i whant something like:

result = ["a"; "e"; "f"; "b"; "d"; "c"]

but that result change in each call of the function.So when i call the function in second time return something like:

result = ["c"; "d"; "b"; "f"; "e"; "a"]

Viewing all articles
Browse latest Browse all 531

Trending Articles