Created
March 25, 2016 16:55
-
-
Save chrisguitarguy/9aba5efa8dc9c92690f7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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