Created
December 10, 2014 15:12
-
-
Save elarkin/25796c34e91793a10b9c to your computer and use it in GitHub Desktop.
Card question in clojure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns foo.card-q) | |
(def deck | |
"Given a set of cards, return a deck of those cards" | |
vector) | |
(def card | |
"Given a map of card properties, return a card with those properties" | |
identity) | |
(def shuffle-deck | |
"Given a deck, return a new deck with the cards in a random order" | |
shuffle) | |
(def combine-decks | |
"Given 1+ decks, return a new deck with all of the cards from all decks" | |
concat) ; or (comp doall concat) if you want eagerness | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment