                  :history []}))
 
 ; required for pausing/resuming the gravity routine
-(def pause-grav (chan))
-(def resume-grav (chan))
+(def stop-grav (chan))
 
 (def battle
   "Boolean flag signaling whether we are in solo or battle mode."

        (let [[value c] (alts! [(:quit-chan @state) uc])]
          (when (= c uc)
            (swap! state assoc :soft-drop value)

            ; force gravity to reset
            (put! pause-grav 0)
            (put! resume-grav 0)
            (recur)))))

    ; Remove key events when quitting

    (doseq [y (reverse (range n-rows))]
      (<! (timeout 10))
      (swap! state assoc-in [:board y] (game-over-row)))))

(declare go-go-gravity!)

(defn spawn-piece!
  "Spawns the given piece at the starting position."
