11-07-2024, 07:03 PM
Followup with code for most efficient shuffle known to mathematicians!:
Code: (Select All)
TopN = 52
ReDim n(1 To TopN) 'repeatable for ref
For i = 1 To TopN
n(i) = i
Next
' shuffle
For i = TopN To 2 Step -1 ' Fisher Yates Shuffle of N Items
Swap n(i), n(Int(Rnd * (i) + 1))
Next
' results of shuffle
For i = 1 To TopN
Print " "; i; "-"; n(i); Chr$(9);
Next
Print
b = b + ...