 (ns minesweeper.core
   (:require [clojure.string :as string]
-            [reagent.core :as r]
-            ))
+            [reagent.core :as r]))
 
 (enable-console-print!)
 

                       (filter #(can-open (get-in game (into [:states] %)) ))
                       (filter (complement mark-to-open))) ] 
      (recur 
        (reduce #(assoc-in % (into [:states] %2) :open) game to-open)
        (into (pop col) (filter #(zero? (get-in game (into [:counts] %) 99)) to-open))
        (into mark-to-open to-open)))
    ;; end of traverse
    (if (all-open? game) (complete-game game) game)))

;; make the first click lucky
;; and swap

  (play-sound :failed)
  (-> game
      (assoc-in [:end] :failed)))

(defn open-cell [game x y]
  (-> game 
      (assoc-in [:states x y] :open)
      (update-in [:need-open] dec)))


(defn open-surround [game col mark-to-open]
  (if (seq col)
