Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
(defn diamond [width offset]
(doseq [w (take-nth 2 (concat (range 1 width) (range width 0 -1)))]
(do
(print (apply str (repeat offset " ")))
(print (apply str (repeat (/ (- width w) 2) " ")))
(print (apply str (repeat w "x")))
(println))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.