Attached is a short demonstration of the Fisher–Yates shuffle. In this particular case we wanted to be able to restore the shuffle back to it's original format, so we had to ensure that the Random number generator produced predictable results depending on the key supplied. To truly randomize the shuffle, you would need to use a better random number generator.
J.A. Coutts
Updated: 08/29/2021
Last edited by couttsj; Aug 29th, 2021 at 11:26 PM.
I found a shuffle routine implemented in JavaScript, but unfortunately it doesn't produce the same results as the Fisher-Yates routine. I find it much easier to implement the JS routine in VB6 than the other way around, so I put the two of them together in the same program for comparison (attached).