 
 (defn inventory-selected [term character error response]
   (assoc character :can-move true)
-  (.moveTo term 0 (inc height)
+  (.moveTo term 0 (inc window-height)
            (if error
              "oh crap!"
              (str "you stare at " (.-selectedText response)))


(defn shorten-line [level line]
  (def shortened-line (take-while #(let [[x y] %
                     x (min (dec width)  (max 0 x))
                     y (min (dec height) (max 0 y))
                     current-block (get-in level [x y])]
                                     (not (current-block :solid))
                                     ) line))


(defn end-points [character]
  (let [{:keys [x y]} character
        _width  (inc window-width)
        _height (inc window-height)
        zw (range 0 _width)
        zh (range 0 _height)
        ziy (range 0 y)
        zix (range 0 x)
        ++yh (range (inc y) window-height)
        ++xw (range (inc x) window-width)
        opposite-wall (vec (case (:direction character)
           "n" (map #(vec [% 0])      zw)
           "s" (map #(vec [% window-height]) zw)
           "w" (map #(vec [0 %])      zh)
           "e" (map #(vec [window-width %])  zh)))
        adjenct-wall (vec (case (:direction character)
           "n" (map #(vec [0 %])      ziy)
           "s" (map #(vec [0 %])      ++yh)
           "w" (map #(vec [% 0])      zix)
           "e" (map #(vec [% 0])      ++xw)))
        adjenct-wall2 (vec (case (:direction character)
           "n" (map #(vec [window-width %])  ziy)
           "s" (map #(vec [window-width %])  ++yh)
           "w" (map #(vec [% window-height]) zix)
           "e" (map #(vec [% window-height]) ++xw)))]
    (concat opposite-wall adjenct-wall adjenct-wall2)
    ))

