Skip to content

sbrugger/human-shuffle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Human Shuffle

This project was inspired by the ever-present coding interview question, "How would you simulate shuffling a deck of cards?" What the interviewer really means by that question is, "How would you randomize the order of elements in an array?" Unfortunately, that question is (in my opinion) much less interesting than the original. I'd much rather think about how I can use an algorithm to simulate the results of what a person would actually do in the shuffling process!

Types of Shuffling Implimented

Riffle Shuffle:
This type of shuffling is what many people first picture when they think of shuffling. The deck is split in half, one half placed in each of the shuffler's hands. The shuffler allows a few cards from the bottom of one hand to fall to a new pile, then allows a few from the bottom of the other hand to fall to the same pile, alternating back and forth until the entire deck sits in the new pile.

References

Since this project is intended for my own 'for fun' purposes, I will admit that my reference is mostly this wikipedia article. I'll add more reference links here as I use them.

About

simulates the way a human shuffles cards

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages