Skip to content

Instantly share code, notes, and snippets.

@dgellow
Created January 27, 2014 14:20
Show Gist options
  • Select an option

  • Save dgellow/8649335 to your computer and use it in GitHub Desktop.

Select an option

Save dgellow/8649335 to your computer and use it in GitHub Desktop.
Playing with a ascii art animation.
(setq lines-data '(("-" (lambda (y-offset)(* 1 y-offset)))
("=" (lambda (y-offset)(* 2 y-offset)))))
(defun exec-cdr ()
(mapc (lambda (c) (message "Value: %S" (nth 1 c))) lines-data)
(funcall (cadar lines-data) 10))
(defun line-down-repeat ()
(dotimes (iteration 5)
(dotimes (n steps)
(erase-buffer)
(mapc (lambda (c) (drow-line (round (funcall (nth 1 c) n)) (car c)))
lines-data)
(sit-for 0.5))))
(defun drow-line (y-offset char)
(let ((c (if (characterp char)
char
(string-to-char char))))
(newline y-offset)
(insert (concat (number-to-string y) " " (make-string 10 c)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment