    :O "#FF0"
    :T "#A0F"})
 
+(def cell-filled? (complement zero?))
+
 ;;------------------------------------------------------------
 ;; Pure Functions operating on a board.
 ;;------------------------------------------------------------

          (swap! state assoc-in [:position 1] ny)
          (do
            (swap! state assoc :board (write-piece-to-board piece x y board))
            (spawn-piece!))))
      (recur))))


  []
  (swap! state assoc :piece (get-rand-piece)
                     :position start-position))

(defn try-collapse!
  "Try to collapse any full rows on the current board."
  []
  (let [board (:board @state)
        cleared-board (remove #(every? cell-filled? %) board)
        n (- (count board) (count cleared-board))
        new-board (into (vec (repeat n empty-row)) cleared-board)]
    (swap! state assoc :board new-board)))

(defn go-go-gravity!
  "Starts the gravity routine."
