2
votes
1answer
173 views

Shuffling algorithm with no “self-mapping”?

To randomly shuffle an array, with no bias towards any particular permutation, there is the Knuth Fischer-Yeats algorithm. In Python: #!/usr/bin/env python import sys from random import randrange ...