Created
April 17, 2016 21:10
-
-
Save copperlight/cf590a4a7bfedf758398a2052050900c 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
(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