Learn R Programming

shuffleCI (version 0.1.0)

shuffle: Riffle Shuffle

Description

This function simulates a standard riffle shuffle of a deck of 52 playing cards.

Usage

shuffle(deck)

Arguments

deck

A list of numbers. 1:52 would simulate a deck of cards in sequential order.

Value

Returns a shuffled list (i.e. deck)

Details

The algorithm is based on the Gilbert-Shannon-Reeds method.

References

Gilbert, E. (1955). Theory of shuffling. Technical memorandum, Bell Laboratories.

Examples

Run this code
# NOT RUN {
shuffle(1:52)
# }

Run the code above in your browser using DataLab