 (defn gen-heuristic-dictionary
   "Generate the dictionnary of heuristics values"
   [depth]
-  (apply merge (for [x '(:min :max :wall :empty)];
+  (apply merge (for [x '(:min :max :wall :empty)]           ;
                  (if (= depth 0)
                    {x 0}
                    {x (gen-heuristic-dictionary (dec depth))}))))

  ""
  [grid-w grid-h state]

    (get-value-for-point (state :lines)
                         (state :last-move)
                         [grid-w grid-h]))

(defn generate-world-from-position
  ""

                                           Double/POSITIVE_INFINITY
                                           got-time?
                                           (not is-first-player)
                                           deepness         ; Steps
                                           grid-width grid-height))

        (recur (inc deepness)))
      (prn "Deepness" deepness)
      )))

(defn -getNextMove
  "Gets the next best move"
  [charmat timeout]
  (let [ret-chan (async/chan (async/sliding-buffer 1))
        timeout-chan (async/timeout timeout)
        got-time? (atom true)
        charmat-seq (lazy-seq charmat)
        state (gen-map-from-charmat charmat-seq {true #{} false #{}} 0)
        is-first-player (even? (+ (count (state true)) (count (state false))))
        grid-width (count (first charmat-seq))
        grid-height (count charmat-seq)]

    (async/go
      (negamax is-first-player
               state
               got-time?
               grid-width
               grid-height
               ret-chan))

    ; Block on the timeout channel
    (async/<!! timeout-chan)

    (let [{decision :best-move} (async/<!! ret-chan)]
      (swap! got-time? (fn [lastval] false))
      (into [] decision))))