Skip to content
♠️ Native card shuffling simulation
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.



A simple python module that is meant to simulate the action of shuffling a python List as if it were a deck of cards.


Riffle -

Predictable behaviours that make a human riffle shuffle imperfect

  • Once a deck of cards is divided to each hand, the amount of cards in each hand is not (likely) equal.
  • As each thumb releases from it's half of the deck, sometimes more than one card drops from a single hand at a time.
  • As the deck in each hand gets more and more thin, the probability of larger chucks of cards dropping from each hand increases.
shuffle.riffle(List original[, int shuffles])

Overhand -

Predictable behaviours that make a human overhand shuffle imperfect

  • Random amounts of cards (chunks) are taken from the top and placed placed in the opposite hand in reverse order (retaining the order within each chunk)
shuffle.overhand(List original[, int shuffles])

Mongean -

A very predictable shuffle, alternating placing the top card on the bottom/top of the new deck

shuffle.mongean(List original[, int shuffles])

Pile -

Predictable shuffle, dealing items into N piles and then rejoining the piles

shuffle.pile(List original, int piles[, int shuffles])


Now available via pip

sudo pip install shuffle


git clone git:// shuffle
cd ./shuffle
sudo python install

Linux Users - Make sure you have the python-dev package installed


import shuffle

riffled_list = shuffle.riffle(original_list, 3)  # riffles the list 3 times
overhanded_list = shuffle.overhand(original_list, 2)  #overhand's the list 2 times
mongeaned_list = shuffle.mongean(original_list, 5)  #mongean shuffle 5 times
piled_list = shuffle.pile(original_list, 3, 6)  #pile shuffle, using 3 piles, 6 times
You can’t perform that action at this time.