           (count))))
 
 (defn complete-game [game]
+  (.ga  js/window 'send', 'event', 'win-game', 'click')
   (play-sound :completed)
   (-> game
       (assoc-in [:end] :completed)))
 
 (defn fail-game [game]
+  (.ga  js/window 'send', 'event', 'fail-game', 'click')
   (play-sound :failed)
   (-> game
       (assoc-in [:end] :failed)))

;;      (println "Changed seconds")
      (set-tick))))


(defn stop-sound [] (when-let [ audio-obj @playing] (.pause audio-obj)))


(def setting (r/atom { :difficulty :beginner}))



(defn first-click [game x y]
  (set-tick)
  ;;google analytics event
  (.ga  js/window 'send', 'event', 'new-game', 'click')
  (if (= 1 (get-in game [:board x y]) )
    (swap-cell game [x y] (find-space game))
    game))
