Created
December 16, 2015 01:19
-
-
Save darkfeline/6f04d08f0b98c0227522 to your computer and use it in GitHub Desktop.
Print star
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
(defun star (input) | |
"Make star." | |
(let* ((l (length input)) | |
(lo (- l 1)) | |
(ll (- (* 2 l) 1)) | |
(star (make-array (list ll ll) :initial-element #\Space))) | |
(dotimes (i l) | |
(let ((a (+ 0 i)) | |
(b (- ll i 1))) | |
(map nil (lambda (x y) (setf (aref star x y) (aref input i))) | |
(list i b lo lo a a b b) (list lo lo i b a b a b)))) | |
(dotimes (i ll) | |
(dotimes (j ll) | |
(write-char (aref star i j))) | |
(write-char #\Newline)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment