Actually, I don't understand it, either. The shifting and adding 64 makes no sense.
Since a deck has 52 cards, the loop is going through all the possible cards of the deck (0-51). Then (i / 13) gives you 0-4, representing the suit of the given card. (i % 13) gives the value or rank of the card (0-12). Therefore, if i is 5 you get the 6 of Hearts.
If you want to shuffle the deck, you can then yse the random generator to move cards to different random positions.
Reputation Points: 3278
Solved Threads: 890
Posting Sage
Offline 7,717 posts
since May 2006