Hacker News new | ask | show | jobs
by jhgb 1878 days ago
Fisher-Yates is one of the simplest things out there IMO.

Isn't the Lehmer code the thing that you want? Then you can specify your permutation with an integer and extract the individual digits from it repeatedly.

1 comments

    Fisher-Yates is one of the simplest
    things out there IMO
Just using "$n xor $something" would be simpler. I am just not sure yet, what a good "$something" is.
How does this guarantee the desired property of the output being a permutation?