Card games have been mankind’s favorite passtime long before the era of computers. Many, perhaps most, popular card games have been programmed into computer software.
Every card game I have ever seen starts by shuffling the cards. The purpose of the shuffling is to rearrange the cards in a more-or-less random order.
Surprisingly, despite the popularity of card games among computer users, just about any programming textbook teaches several algorithms on how to sort a pack of cards but most offer no clue on how to shuffle it. Read the rest of this entry →