shuffle: Riffle Shuffle

Description Usage Arguments Details Value Author(s) References Examples

Description

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

Usage

1
shuffle(deck)

Arguments

deck

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

Details

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

Value

Returns a shuffled list (i.e. deck)

Author(s)

Kyle Caudle

References

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

Examples

1
shuffle(1:52)

Example output

Loading required package: plotrix
 [1] 32 33  1 34 35  2  3  4 36  5 37 38 39 40 41 42 43  6  7  8  9 10 44 45 11
[26] 46 12 13 47 48 14 15 16 17 18 19 20 21 49 22 23 24 50 25 26 27 28 51 29 52
[51] 30 31

shuffleCI documentation built on May 2, 2019, 5:11 a.m.

Related to shuffle in shuffleCI...