Created
January 27, 2014 14:20
-
-
Save dgellow/8649335 to your computer and use it in GitHub Desktop.
Playing with a ascii art animation.
This file contains hidden or 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
| (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