 ; functional model
 ; ----------------------------------------------------------
 ; START: constants
+(def sqrt3 (Math/sqrt 3.0))
+
 (def width 120)
 (def height 100)
 (def point-size 8)
 (def ship-size 1.5)
+(def ship-life 3)
 (def turn-speed 4)
 (def shot-size (/ ship-size 10))
 (def shot-speed 1.5)

    (> y (+ height size))
    ))

(def win? (constantly false))

(defn lose? [ship]
  (out-of-bounds? ship))

; ----------------------------------------------------------------------
; Actions

    (alter asteroids (partial map move))
    nil))

(defn resolve-collision! [ship asteroids]
  (dosync
    (let [[ship* asteroids*] (resolve-all-collision @ship @asteroids)]
      (ref-set ship ship*)
      (ref-set asteroids asteroids*))))

(defn do-action!
  ([ship {:keys [rotation acceleration shoot] :as action} modifier]
   (when rotation (dosync (alter ship turn (* modifier rotation))))
