   (mapcat concat (map-indexed (fn [y line] (map-indexed (fn [x cell] [cell x y]) line)) place)))
 
 (defn map-with-xy [f place]
-  (dorun 
+  (doall 
     (map (fn [e] (apply f e)) (with-xy place))))
 
 (defn get-xy [x y place]

       (alter-meta! (var ~fn-name) assoc :source (quote ~&form))
       (var ~fn-name)))

(defn ascii-to-place [ascii]
  (let [char-to-cell (fn [c]
    (case c
      \| {:type :vertical-wall}
      \- {:type :horizontal-wall}
      \. {:type :floor}
      \+ {:type :door-closed}
      \# {:type :corridor}
      nil))]
    (vec (map (fn [line] (vec (map char-to-cell line))) ascii))))

(defn init-place-0 []
  (ascii-to-place
    ["----   ----"
     "|..+## |..|"
     "|..| ##+..|"
     "----   ----"]))

(defn init-world []
  {:places {:0 (init-place-0)}


(defn render [state]
  (do
    (println "render")
    (s/clear (state :screen))
    ;; draw map
    (println "map-with-xy")
    (map-with-xy
      (fn [cell x y]
        (println cell x y)
        (when (not (nil? cell))
          (let [cell-items (cell :items)
                out-char (if (not (nil? cell-items))
                           (case :ring 
                             :ring           ["="]
                             :food           ["%"]
                             :bow            [")"]
                             :sword          [")"]
                             :armor          ["["]
                             :shoes          ["!"]
                             :wand           ["/"]
                             :spellbook      ["+"]
                             :scroll         ["?"]
                             :coins          ["$" {:fg :yellow :styles #{:bold}}]
                             :amulet         ["\"" {:fg :blue :styles #{:bold}}]
                             ["?"])
                           (case (cell :type)
                            :vertical-wall   ["|"]
                            :horizontal-wall ["-"]
                            :floor           ["."]
                            :door-open       ["+" {:fg :red :styles #{:bold}}]
                            :door-closed     ["+" {:fg :black :bg :red :styles #{:bold}}]
                            :corridor        ["#"]
                            ["?"]))]
            (apply s/put-string (state :screen) x y out-char))))
        
      (current-place state))
    ;; draw character
    (println (-> state :world :player))
