         *
         ******x"
   [[x1 y1] [x2 y2]]
-  (println "horizontal-s-segment")
+  #_(println "horizontal-s-segment")
   (let [mid-x (int (/ (+ x1 x2) 2))]
     (concat (map #(vector % y1)    (range* x1 mid-x))
             (map #(vector mid-x %) (range* y1 y2))

  "When merging cells, given their types, determine
   the type of the resulting cell."
  [cell1 cell2]
  (println "merging cells" cell1 "," cell2)
  (let [cell1-type (get cell1 :type)
        cell2-type (get cell2 :type)]
    (cond
      (or (and (contains? #{:corridor :moss-corridor :white-corridor} cell1-type)
               (contains? #{:horizontal-wall :horizontal-wall-alt :vertical-wall :vertical-wall-alt :close-door
                            :moss-horizontal-wall :moss-horizontal-wall-alt :moss-vertical-wall :moss-vertical-wall-alt
                            :white-horizontal-wall :white-horizontal-wall-alt :white-vertical-wall :white-vertical-wall-alt} cell2-type))
          (and (contains? #{:corridor :moss-corridor :white-corridor} cell2-type)
               (contains? #{:horizontal-wall :horizontal-wall-alt :vertical-wall :vertical-wall-alt :close-door
                            :moss-horizontal-wall :moss-horizontal-wall-alt :moss-vertical-wall :moss-vertical-wall-alt
                            :white-horizontal-wall :white-horizontal-wall-alt :white-vertical-wall :white-vertical-wall-alt} cell2-type)))
        :close-door
      (= cell1-type :nil)
        cell2-type
      (= cell2-type :nil)

  "Generate a random grid and print it out."
  [& args]
  (println "generating...")
  (print-cells (get (random-place 80 25) :cells)))

