 
 (defn new-game []
   (with-available-moves
-    {:board (new-board)
-     :player (rand-nth players)
-     :moves {}
-     :help false
-     :scores
-     {:blue 12
-      :red 12
-      :green 12}}))
+    (with-cells-strength
+      {:board (new-board)
+       :player (rand-nth players)
+       :moves {}
+       :help false
+       :scores
+       {:blue 12
+        :red 12
+        :green 12}})))
 
 (defonce app-state (atom (new-game)))
 (def board (reagent/cursor app-state [:board]))

    [clojure.string :as str]))

(enable-console-print!)


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

;; ARTIFICIAL INTELLIGENCE
;; -----------------------------------------

(defn compute-cell-strength
  "Compute a cell strength based on the number of walls it has"
  [board point]
  (let [neighbors (coord-neighbors point)
        walls (filter #(= :wall (get-in board % :wall)) neighbors)]
    (+ 1 (* (count walls) 0.25))))

(defn with-cells-strength
  "Adds to a given game the strength of each of its cells"
  [{:keys [board] :as game}]
  (assoc game :cells-strength
    (reduce
      #(assoc %1 %2 (compute-cell-strength board %2))
      {} all-positions)))

#_(defn sum-strength
   "Compute total strength of taking the provided cells"
   [cells-strength taken-cells]
   (transduce (map cells-strength) + taken-cells))

(defn move-strength
  "Compute the strength of a move, based on the converted cells"
  [cells-strength converted-filter [move converted]]
  (transduce
    (comp
      (filter converted-filter)
