Additionally, paste this code immediately after the opening tag:

Divide & Conquer Card Shuffler

Divide & Conquer is now open source on GitHub: https://github.com/akeeton/Divide_And_Conquer_Card_Shuffler ...

Free

Store review

Divide & Conquer is now open source on GitHub: https://github.com/akeeton/Divide_And_Conquer_Card_Shuffler


Divide & Conquer helps you completely shuffle a real deck of cards. Simply place your phone or tablet on a table and deal cards one at a time into each pile the app points to. Divide & Conquer is great for randomizing a new pack of playing cards or tackling an unwieldy deck (of any size). Works for any game that uses cards, including poker, blackjack, bridge, Magic: The Gathering, Pokemon, Yu-Gi-Oh!, and more.

Technical Details
Note: Internet permission is only used for BugSense crash reporting (http://www.bugsense.com/)

Divide & Conquer internally assigns a random number to each card in the deck. Then it guides you through the process of using Bucket Sort (http://en.wikipedia.org/wiki/Bucket_sort) to arrange the randomly-numbered cards in order. The assigned numbers end up in sorted order, and since those numbers were randomly assigned, the resulting deck is shuffled!

For example, take a 52-card deck of playing cards. The numbers 1-52 are randomly assigned to each card. In the first pass, Divide & Conquer guides you through dealing all 52 cards into one of eight piles. Those piles, from #1 to #8, contain cards 1-7, 8-14, 15-21, 22-28, 29-34, 35-40, 41-46, 47-52. This is the first step of Bucket Sort. Divide & Conquer will continue to guide you through further sorting the piles until the whole deck is "sorted" (shuffled).

Acknowledgements
HoloEverywhere - Christophe Versieux (https://github.com/ChristopheVersieux/HoloEverywhere)
AutoResizeTextView - Chase Colburn (http://stackoverflow.com/a/5535672/68086)
Number sounds - Corsica_S (http://www.freesound.org/people/Corsica_S/sounds/82986/)

Last update

Oct. 20, 2019

Read more