 
 (defn get-neighbour-coords
   [x y width height]
-  (for  [ny (range (- y 1) (+ y 2))
-         nx (range (- x 1) (+ x 2))
-         :when (and (not (and (= nx x) (= ny y))))]
-      [nx ny]))
+  [[(- x 1) y]
+   [(+ x 1) y]
+   [x (- y 1)]
+   [x (+ y 1)]])
 
 (defn- all-coords-with-neighbours
   [width height]

            (let [v (get-in hm [x y] 0)]
              (if (> v 0) (inc count) count)))
          0 coords))                              
;   
; (defn improved-round
;   [hm all-coords]
;   (r/fold (fn [acc [x y neighbours]]
;             (let [n (count-pos-coords neighbours hm)]
;               (update-in acc [x y] #(if (= % 0) (+ % n) (+ % n 1)))))
;           hm
;           all-coords))
;           
          
(defn improved-round
  [hm all-coords]
  (reduce (fn [acc [x y neighbours]]
            (let [n (count-pos-coords neighbours hm)]

(ns ux-analyzer.heat-map
  (:use [mikera.image.core]
        [mikera.image.colours]
        [mikera.image.spectrum])
  (:import [Math])
  (:require [clojure.core.reducers :as r]))

