             (cond (not wid) :wid
                   (not bid) :bid))))
 
-(defn decide-move 
+(defn decide-move
   [{:keys [moves bid wid ended started] :as game} uid mv]
   (let [bwid (next-bwid game uid)
         color (cond (= bwid :bid) "b" (= bwid :wid) "w")]
     {:bwid bwid
      :color color
      :status
-     (cond 
+     (cond
        (not game) :no-game
        (not color) :not-a-player
        (= started 0) :not-started


(defn should-end? [game]
  (or (->> game :moves (some #(= "resign" (:mv %))))
      (->> game 
           :moves
           (filter (comp (partial = "pass") :mv)) 
           count 
           (= 2))))

(defn show [{:keys [size moves]}]
  (let [mvc (moves-to-mvc moves)]
    (str 
      (apply str (repeat (+ 2 size) "-")) "\n"
      (apply str (for [v (range size)]
        (str "|"
           (apply str (for [h (range size)] 
                        (case (mvc (str (-> h (+ 97) char) (-> v (+ 97) char))) 
                          "b" "x" 
                          "w" "o" 
                          nil "+")))
           "|\n")))
      (apply str (repeat (+ 2 size) "-")))))


(defn get-group-at
  ([{:keys [size moves]} color mv]
    (get-group-at size
                  (moves-to-mvc moves)
                  color
                  #{}
                  mv))

  ([size mvc color found mv]
  (if (= (mvc mv) color)
    (conj
      (apply ss/union (map
        #(get-group-at
           size
           mvc
           color
           (conj found mv)
           %)
        (-> mv (get-near-cells size) set (ss/difference found))))
      mv)
    found)))

(defn get-dame [{:keys [size moves]} group]
  (let [mvc (moves-to-mvc moves)]
  (->> group
      (map #(get-near-cells % size))
