There are no reviews yet. Be the first to send feedback to the community and the maintainers!
Repository Details
Given a list of items that is guaranteed to contain an even number of elements (note that the integer zero is an even number), create and return a list produced by performing a perfect riffle to the items by interleaving the items of the two halves of the list in an alternating fashion. When performing a perfect riffle, also known as the Faro shuffle, the list of items is split in two equal sized halves, either conceptually or in actuality. The first two elements of the result are then the first elements of those halves. The next two elements of the result are the second elements of those halves, followed by the third elements of those halves, and so on up to the last elements of those halves. The parameter out determines whether this function performs an out shuffle or an in shuffle, that is, from which half of the list the alternating card is taken first.