 (defn deg->rad [d]
   (* Math/PI (/ d 360)))
 
-(def black "#000000")
-(def yellow "#FFDB7F")
-(def red "#E88E7F")
-(def purple "#DA98FF")
-(def blue "#88BAE8")
-(def green "#7FFFA5")
-
 (set! (.-onresize js/window) resized)
 
 (resized)

    (.lineTo context tx ty)
    (.stroke context)))

(defn fill_circ [x y w h];; colour]
  (set! (.-fillStyle context) red)
  (set! (.-strokeStyle context) yellow)
  (let [r (/ (* cell-size w) 2)

             (* cell-size @width)
             (* cell-size @height)))

(defn draw []
  (blank)
  (doseq [[k v] block_map]
    (let [x (first (:position @v))
          y (- @height (last (:position @v)))
          w (:width @v)
          h (- (:height @v))]
      (cond
        (= (:type @v) ::brick)(fill_sq x y w h)
        (= (:type @v) ::wedge)(fill_tri x y w h)
        (= (:type @v) ::ball)(fill_circ x y w)
        :else
        (println "draw table")))
    (fill_txt (first (:position @v))
              (- @height (last (:position @v)))
              (:name @v))))

(draw)

(defn put [o s]
  (put-on (block_map o) (block_map s))
  (draw))

