DEV Community

Discussion on: Daily Challenge #198 - 21 Blackjack

Collapse
 
not_jffrydsr profile image
@nobody

Clojure ✌🏿

(ns dailyChallenge.one-ninety-eight)

(defn scoreHand [hand]
  (let [WIN 21
        CARDS {:2 2, :3 3, :4 4, :5 5, 
               :6 6 :7 7, :8 8, :9 9, 
               [:J :Q :K] 10, :A [1 11]}] ;;this is why I ♥ Clojure
    (for [card hand]
         (apply + (CARDS card))...To be continued (need to save somewhere)))