   "When merging cells, given their types, determine
    the type of the resulting cell."
   [cell1 cell2]
-  (println "merging cells" 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
+               (contains? #{:horizontal-wall :horizontal-wall-alt :vertical-wall :vertical-wall-alt :close-door :open-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))
+                            :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
+               (contains? #{:horizontal-wall :horizontal-wall-alt :vertical-wall :vertical-wall-alt :close-door :open-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
+                            :white-horizontal-wall :white-horizontal-wall-alt :white-vertical-wall :white-vertical-wall-altr}
+                          cell2-type)))
+        (rand-nth [:close-door :open-door :corridor :moss-corridor :white-corridor])
+      (every? #{:corridor :moss-corridor :white-corridor} [cell1-type cell2-type])
+        cell1-type
       (= cell1-type :nil)
         cell2-type
       (= cell2-type :nil)

          *
          x"
  [[x1 y1] [x2 y2]]
  (println "horizontal-corner-segment")
  (concat (map #(vector x1 %) (range* y1 y2))
          (map #(vector % y2) (range* x1 x2))))


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

