         [this x y]
         (+ 0.5 (* 0.5 (snoise this x y))))))))
 
+
+
+
+;; REPL code for displaying noise as ascii art
+;;(def px (partition 200 (for [x (range -100 100) y (range -100 100)] (noise n (/ x 10) (/ y 10)))))
+
+;;(def ascii-chars [\# \A \@ \$ \% \= \+ \* \: \, \. \space])
+
+;;(def n (create-noise))
+
+;;(doseq [line px]
+;;(println
+;;  (apply str (map (fn [c]
+;;                    (let [idx (if (zero? c)
+;;                                  (dec (count ascii-chars)) 
+;;                                  (- (count ascii-chars)
+;;                                     (* c (count ascii-chars))))]
+;;                      (nth ascii-chars (max idx 0))))
+;;                  line))))

(def ^:private grad3 [[ 1  1  0]
                      [-1  1  0]
                      [ 1 -1  0]
                      [ 1  0  1]
                      [-1  0  1]
                      [ 1  0 -1]

                      [-1,  1, -1,  0]
                      [-1, -1,  1,  0]
                      [-1, -1, -1,  0]])
(def ^:private f2 (* 0.5 (dec #+clj  (Math/sqrt 3.0)
                              #+cljs (.sqrt js/Math 3.0))))
(def ^:private g2 (/ (- 3.0
                        #+clj  (Math/sqrt 3.0)
