Card shuffles: Difference between revisions

Added on-site definitions of the two shuffles we are focusing on
m (J: simplify overhand shuffle)
(Added on-site definitions of the two shuffles we are focusing on)
Line 3:
 
The task here is to implement the (seemingly) more common techniques of the riffle shuffle and overhand shuffle for ''n'' iterations. Implementing playing cards is not necessary if it would be easier to implement these shuffling methods for generic collections. Where possible, compare this to a standard/built-in shuffling procedure.
 
One iteration of the riffle shuffle is defined as:
#Split the deck into two piles
#Merge the two piles by alternating taking one card from each pile
#The merged deck is now the new "shuffled" deck
 
One iteration of the overhand shuffle is defined as:
#Take a group of consecutive cards from the top of the deck. For our purposes up to 20% of the deck seems like a good amount.
#Place that group on top of a second pile
#Repeat these steps until there are no cards remaining in the original pile
#The second pile is now the new "shuffled" deck
 
'''Bonus:''' Implement other methods described [[wp:Shuffling#Shuffling_techniques|here]]. Allow for "human errors" of imperfect cutting and interleaving.
Anonymous user