                                       [x y (+ x width) (+ y height)]))
                                     (range columns)))
                              (range rows))
-        rooms        (mapcat #(apply room-to-cellsxy %) room-bounds)
+        ;rooms        (mapcat #(apply room-to-cellsxy %) room-bounds)
         room-centers-to-room-bounds
                      (reduce (fn [m room-bounds]
-                               (let [[x1 y1 x2 y2] room-bounds]
-                                 (assoc m [(int (/ (+ x1 x2) 2))
-                                           (int (/ (+ y1 y2) 2))]
-                                          room-bounds)))
+                               (assoc m (room-bounds-to-center room-bounds)
+                                        room-bounds))
                              {}
                              room-bounds)
         room-centers (keys room-centers-to-room-bounds)

(defn room-to-cellsxy
  "Convert the bounds of a room into a list of points that represent the room."
  [min-x min-y max-x max-y]
  (let [top    [(map (fn [x] [x min-y {:type :horizontal-wall}]) (range min-x (inc max-x)))]
        bottom [(map (fn [x] [x max-y {:type :horizontal-wall}]) (range min-x (inc max-x)))]
        middle-line (concat [[min-x {:type :vertical-wall}]]
                            (vec (map (fn [x] [x {:type :floor}]) (range (inc min-x) max-x)))
                            [[max-x {:type :vertical-wall}]])
        middle-lines (vec (map (fn [y] (map (fn [[x cell]] [x y cell]) middle-line)) (range (inc min-y) max-y)))
        lines (concat top middle-lines bottom)]
    (apply concat lines)))

(defn points-to-fully-connected-graph

    (= y max-y)
      :horizontal
    :else
      (rand-nth [:vertical :horizontal])
      #_(assert false (format "Unknown wall type %d %d %d %d %d %d" min-x min-y max-x max-y x y))))

(defn multi-part-segment
  [from from-type to to-type]
