Closed job closed 6 days ago
@botovq was kind enough to point out that although my earlier implementation produced random-ish ordering, it strictly speaking wasn't Fisher-Yates.
We need to ensure j is a random number between i and list.count see the second example in the 'Modern Algorithm' https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle
j
i
list.count
@botovq was kind enough to point out that although my earlier implementation produced random-ish ordering, it strictly speaking wasn't Fisher-Yates.
We need to ensure
j
is a random number betweeni
andlist.count
see the second example in the 'Modern Algorithm' https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle