Skip to content

♠️ A few card shuffling simulations written as a clojure library

License

Notifications You must be signed in to change notification settings

jondavidjohn/clojure-card-shuffle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clojure Card Shuffle

Build Status

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

Types

All shuffle types support an optional second parameter to perform the shuffle multiple times.

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.
(riffle coll times)

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)
(overhand coll times)

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

unit tests included

(mongean coll times)

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

unit tests included

; `piles` is how many piles to use
(pile coll piles times)

Usage

Available via clojars.org

Development

This project usees leinigen 2.x for development, you can install it via hombrew with

brew install leiningen

Once you have leiningen 2 installed

git clone git@github.com:jondavidjohn/clojure-card-shuffle.git
cd clojure-card-shuffle
lein install
lein test

About

♠️ A few card shuffling simulations written as a clojure library

Resources

License

Stars

Watchers

Forks

Packages

No packages published