    * The immediate gain
    * The worse immediate lost afterwards"
   {:pre [(player? player)]}
-  [game player]
+  [cells-strength game player]
   (let [moves (get-in game [:moves player])
         others (remove #{player} players)]
     (first
       (fast-max-key
         (fn [[m converted :as move]]
           (let [new-game (play-move game m)
-                diff-score (move-strength (:cells-strength game) identity move)
-                losses (map #(worst-immediate-loss new-game % player) others)]
+                diff-score (move-strength cells-strength identity move)
+                losses (map #(worst-immediate-loss cells-strength new-game % player) others)]
             (- diff-score (apply max losses))))
         moves))
     ))

(defn- worst-immediate-loss
  "Return the next worse lost game move for 'looser' if 'player' plays"
  {:pre [(player? player) (player? looser)]}
  [game player looser]
  (let [converted-filter #(= looser (:looser %))
        all-moves (get-in game [:moves player])]
    (transduce
      (map #(move-strength (:cells-strength game) converted-filter %))
      max all-moves)))

(defn best-move

;; -----------------------------------------

(defn- handle-ai []
  (let [ai-algo (get @ai-players @current-player)
        move (ai-algo @app-state @current-player)]
    (swap! app-state play-move move)))

