 (def asteroid-max-rotation-speed 4)
 (def asteroid-damage 1)
 (def debris-life-millis 3000)
+
+(defn random-int [from to]
+  (let [range (- to from)]
+    (+ from (rand-int range))))
+
+(defn random [from to]
+  (let [range (- to from)]
+    (+ from (rand range))))
+
+(defn vary [variance n]
+  (let [from (* n (- 1 variance))
+        to (* n (+ 1 variance))]
+    (random from to)))
 
 (def ammunition-types {:projectile {:size         (/ ship-size 10)
                                     :shape        [[-1.0 -5.0] [1.0 -5.0] [0.0 1.0]]

           (java.awt.event ActionListener KeyListener)
           (javax.sound.sampled AudioSystem FloatControl$Type))
  (:require [asteroids.matrix-math :as m])
  #_(:use examples.import-static))
#_(import-static java.awt.event.KeyEvent VK_LEFT VK_RIGHT VK_UP VK_DOWN)

; ----------------------------------------------------------
; functional model
; ----------------------------------------------------------
; START: constants

(def width 160)
(def height 85)

  (basic-move asteroid))

(defmethod move :debris [{:keys [life-time size] :as debris}]
  (if (< life-time turn-millis)
    nil
    (let [debris (basic-move debris)
          size (* size (- 1 (/ turn-millis life-time)))
