 
 ;; Constants
 
-; TODO revisit *all* of these atoms
-; consolidate them and reconcile them with this "visualization state" atom
-
-(def cell-size 10)
 (def grid-width 100)
 (def grid-height 100)
 (def canvas-height 800)
 (def canvas-width 800)
+
+; TODO revisit *all* of these atoms
+; consolidate them and reconcile them with this "visualization state" atom
 
 (defonce selected-tab (r/atom :drunkard))
 (defonce ms-per-tick (r/atom 16))

                         @num-iterations
                         @smoothing-passes)
      ::generate/grid
      (draw-grid (/ canvas-width grid-width))))

;; Reagent components

(defn row [a-row y]
  [:div.row
   (for [[x cell] (map-indexed vector a-row)]
     ^{:key ["cell" x y]} [:div.cell {:class (name cell)}])])

(defn grid [visualization-state]
  [:div.world
   (conj (for [[y a-row] (map-indexed vector (@visualization-state ::generate/grid))]
           ^{:key ["row" y]} [row a-row y])

         (when-let [[x y] (@visualization-state ::active-cell)]
           ^{:key "active-cell"} [:div.cell.active {:style {:left (* cell-size x)
                                                            :top  (* cell-size y)}}]))])

(defn slider [an-atom min max step callback]
  (let [_ @an-atom]

   (when (= @selected-tab :drunkard)
     [:div.drunkard-specific
      [:p (str "Dig until there are " @num-empty-cells " empty cells in the grid")]
      [slider num-empty-cells 0 1000 50
       #(draw-grid ((generate/drunkards-walk grid-width grid-height @num-empty-cells)
                     ::generate/grid))]])

   (when (= @selected-tab :automata)
     [:div.cellular-specific
