Skip to content

Instantly share code, notes, and snippets.

@darkfeline
Created December 16, 2015 01:19
Show Gist options
  • Save darkfeline/6f04d08f0b98c0227522 to your computer and use it in GitHub Desktop.
Save darkfeline/6f04d08f0b98c0227522 to your computer and use it in GitHub Desktop.
Print star
(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