Skip to content

Instantly share code, notes, and snippets.

@chrisguitarguy
Created March 25, 2016 16:55
Show Gist options
  • Save chrisguitarguy/9aba5efa8dc9c92690f7 to your computer and use it in GitHub Desktop.
Save chrisguitarguy/9aba5efa8dc9c92690f7 to your computer and use it in GitHub Desktop.
(require '[clojure.string :as string])
(defn- make-rows [height]
(loop [out [] h height]
(if (< h 1)
(map #(apply str %) out)
(recur
(conj out (concat (repeat (- height h) \space) (repeat h \#)))
(dec h)))))
(defn -main [& args]
(let [height (Integer/parseInt (read-line))]
(doseq [row (reverse (make-rows height))]
(println row))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment