Last active
July 13, 2020 11:32
-
-
Save songtianyi/857acad648d654f6c84d783f296dd896 to your computer and use it in GitHub Desktop.
cards shuffle algorithm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
START WITH FRESH DECK | |
GET RANDOM SEED | |
FOR CT = 1, WHILE CT <= 52, DO | |
X = RANDOM NUMBER BETWEEN CT AND 52 INCLUSIVE | |
SWAP DECK[CT] WITH DECK[X] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment