           (rand-int 2))))))
 
 (defn neighbouring [x y]
-  (for [dx (range -1 2)
-        dy (range -1 2)
+  (for [dx (range (- neighbour-width) (inc neighbour-width))
+        dy (range (- neighbour-width) (inc neighbour-width))
         :when (not (and (= dx 0) (= dy 0)))]
-    [(+ x dx) (+ y dy)]))
+    [dx dy]))
+
+(defn add-weight [v dx dy] v)
 
 (defn get-neighbours [field x y]
-  (map (fn [[x y]] (get-in field [y x] 0))
+  (map (fn [[dx dy]]
+         (add-weight (get-in field [(+ y dy) (+ x dx)] 0) dx dy))
        (neighbouring x y)))
 
 (defn check-spawn [v neighbours]


(defn draw-dot-at [field x y]
  (let [color (to-color (get-in field [y x]))]
    (apply q/stroke color) ; with-stroke doesn't work somehow
    (q/point x y)
    ))

(defn draw-state [s]


(def width 100)
(def height 100)
(def expand 4)
(def neighbour-width 1)
(def hue 100)
(def sat 200)
(def max-b 200)
