 
                 (<= 4 (+ prev-right-streak-count prev-right-partial-streak-count)) 
                     (+ prev-right-direct-streak prev-right-streak-count)
-                :else 1))
-            ))
+                :else 1)
+            )
         ; Types identiques
-        (let [op (if (or (= :min prev-left-streak-type) (= :min prev-right-streak-type)) + +)]
-          (op (cond
-                (not= :max prev-left-streak-type) 0 ;
-                (= 4 (+ prev-left-direct-streak prev-right-direct-streak)) Double/POSITIVE_INFINITY
-                                                                             
-                (and (= 3 (+ prev-left-direct-streak prev-right-direct-streak))
-                     (>= prev-right-partial-streak-count 1)
-                     (>= prev-left-partial-streak-count 1)) 50000
-                (<= 5 (+ prev-left-direct-streak prev-right-direct-streak)) 0
-
-                :else (+ prev-left-direct-streak
-                         prev-left-streak-count
-                         prev-right-direct-streak
-                         prev-right-streak-count)))))
+          (cond
+            (not= :max prev-left-streak-type) 0 ;
+            (= 4 (+ prev-left-direct-streak prev-right-direct-streak)) Double/POSITIVE_INFINITY
+
+            (and (= 3 (+ prev-left-direct-streak prev-right-direct-streak))
+                 (>= prev-right-partial-streak-count 1)
+                 (>= prev-left-partial-streak-count 1)) 50000
+            (<= 5 (+ prev-left-direct-streak prev-right-direct-streak)) 0
+
+            :else (+ prev-left-direct-streak
+                     prev-left-streak-count
+                     prev-right-direct-streak
+                     prev-right-streak-count)))
 
       (let [left (first left-part)
             right (first right-part)

  {:v  x
   :h  y
   :d1 (- x y)
   :d2 (- (dec grid-width) x y)}
  )

(defn gen-lines
  [points grid-w grid-h]

    (map
      #(map + point %)
      adjacent-transform)))
(def gen-surrounding-points (memoize gen-surrounding-points))

(defn gen-children-points
  [parent-state grid-w grid-h]
