           ai-events ([msg] (when (= msg :ai-play) (handle-ai!)))
           (async/timeout ai-move-delay) ([_] (put! ai-events :ai-play))
           )))
-    
+
     {:player-events player-events
      :game-events game-events}))
 


(defn new-game []
  (let [board (board/new-board)]
    (with-available-moves
      {:board board
       :player (rand-nth cst/players)
       :moves {}
       :help false
       :ai-players
       {:red (partial best-move (compute-cells-strength board))
        :green (partial best-move (compute-cells-strength board))}
       :scores
       {:blue cst/init-block-count
        :red cst/init-block-count
        :green cst/init-block-count}})))

(defonce app-state
  (atom {:games (list (new-game))
         :help false}))

(def game (reaction (first (get-in @app-state [:games])))) 
(def board (reaction (get-in @game [:board])))
(def scores (reaction (get-in @game [:scores])))
(def current-player (reaction (get-in @game [:player])))

        moves))
    ))

(defn with-ai-data
  "Add the AI data needed to play the game"
  [init-game]
  (merge init-game
    {:ai-players
     {:red (partial best-move (compute-cells-strength board))
      :green (partial best-move (compute-cells-strength board))}}
    ))


;; -----------------------------------------
;; GAME STATE
