   (or (= Double/POSITIVE_INFINITY (state :heuristic-result))
       (= Double/NEGATIVE_INFINITY (state :heuristic-result))))
 
-  (defn minimax-decision
-    [grid-w grid-h is-first-player state timeout]
-
-    (println grid-w grid-h is-first-player state)
-    (if (and
-          is-first-player
-          (empty? (state true)))
-      ; Return a vector
-      ; If the board is empty and we are player 1
-      [(long (/ grid-w 2)) (long (/ grid-h 2))]
-      ; Otherwise
-      ;(gen-successors grid-w grid-h is-first-player state)
-      ))
+(defn minimax-decision
+  [grid-w grid-h is-first-player state timeout]
+
+  (println grid-w grid-h is-first-player state)
+  (if (and
+        is-first-player
+        (empty? (state true)))
+    ; Return a vector
+    ; If the board is empty and we are player 1
+    [(long (/ grid-w 2)) (long (/ grid-h 2))]
+    ; Otherwise
+    ;(gen-successors grid-w grid-h is-first-player state)
+    ))
 
 (defn- is-it-a-win?
   ""

                                           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))))
(defn build-all-lines-from-state
  [state grid-w grid-h is-first-player]

  {:max (gen-lines (state is-first-player) grid-w grid-h)
   :min (gen-lines (state (not is-first-player)) grid-w grid-h)}

  ;{:max (gen-lines (state true) grid-w grid-h)
  ; :min (gen-lines (state false) grid-w grid-h)}

  ;
  )

(defn get-value-for-point
