 
 
 (defn first-click [game x y]
-  (reset! time-tick (quot (.getTime (js/Date.)) 1000))
+  (set-tick)
   (if (= 1 (get-in game [:board x y]) )
     (swap-cell game [x y] (find-space game))
     game))

   :mines mines
   :end false
   :first true
   }))

(defn all-open? [game]

(defn format [n]
  (let [s (str n)]
    (str (apply str (repeat (- 3 (count s)) 0)) s)))
(defn timer-component[]
;;  (println "trigger timer and rendering timer component ")
  (js/setTimeout update-timer 200)
  [:input#display {:type      "text" 
                   :read-only true
                   :value     (format (min 999 (quot (- @time-tick (@game-state :start)) 1000)))} ])


;; UI components
