~willvaughn/kata

87e31fd9bfd86e8bf8d155d62ea9eaeb7e44bbc4 — William Vaughn 1 year, 5 months ago 8f79c51
exercism elyses-destructured-enchantments solution
M exercism/clojure/elyses-destructured-enchantments/src/elyses_destructured_enchantments.clj => exercism/clojure/elyses-destructured-enchantments/src/elyses_destructured_enchantments.clj +10 -10
@@ 2,29 2,29 @@

(defn first-card
  "Returns the first card from deck."
  [deck]
)
  [[top-card & _]]
  top-card)

(defn second-card
  "Returns the second card from deck."
  [deck]
)
  [[_ card-two & _]]
  card-two)

(defn swap-top-two-cards
  "Returns the deck with first two items reversed."
  [deck]
)
  [[top-card card-two & deck]]
  (into [card-two top-card] deck))

(defn discard-top-card
  "Returns a sequence containing the first card and
   a sequence of the remaining cards in the deck."
  [deck]
)
  [[top-card & deck]]
  [top-card deck])

(def face-cards
  ["jack" "queen" "king"])

(defn insert-face-cards
  "Returns the deck with face cards between its head and tail."
  [deck]
)
  [[top-card & deck]]
  (remove nil? (flatten [top-card face-cards deck])))