 (defn update-scores
   "Update the scoring based on the provided move"
   [scores move]
-  {:pre [(move/conversion? move)]}
   (let [delta (count (:taken move))]
     (-> scores
       (update (:winner move) + delta)
       (update (:looser move) - delta)
-      )))
+      (dissoc :empty))))

(ns triboard.logic.scores
  (:require
    [cljs.spec :as s :include-macros true]
    [cljs.spec.impl.gen :as gen]
    [triboard.logic.constants :as cst]
    [triboard.logic.move :as move]
    ))

;; -----------------------------------------

(s/def ::pos-int (s/and integer? #(<= 0 %)))
(s/def ::scores (s/map-of ::cst/player ::pos-int))

(s/fdef update-scores
  :args (s/tuple ::scores ::move/conversion)
  :ret (s/map-of ::cst/player integer?))                    ;; Hard to ensure more

(def initial-scores
  {:blue cst/init-block-count
