Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
(defn diamond [width offset]
(doseq [w (take-nth 2 (concat (range 1 width) (range width 0 -1)))]
(print (apply str (repeat offset " ")))
(print (apply str (repeat (/ (- width w) 2) " ")))
(print (apply str (repeat w "x")))
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.