Here is my C# code that uses cryptographically strong pseudo random numbers to shuffle a deck:
I would say that your routine, as other people's before it, randomizes the deck(s) rather than “shuffles” it (them). With this routine there is a chance that the top card of the deck before the randomization could appear on the bottom of the deck after the randomization. This doesn’t happen after one riffle shuffle (or even two or three).
Technically this routine could completely reverse the deck’s order which is not possible in a riffle shuffle, a wash, or via continuous shufflers. (Yeah, someone’s going to try to prove me wrong on this point.)
I would like to see a routine that models:
- washing cards
- a riffle shuffle with n decks
- various continuous shufflers
I’d have a go at it but I haven’t programmed in 17 years, don’t have a need for one, and have too many programming projects that I am already not creating.