Skip to content

Instantly share code, notes, and snippets.

Created February 12, 2014 21:16
Show Gist options
  • Save anonymous/8964688 to your computer and use it in GitHub Desktop.
Save anonymous/8964688 to your computer and use it in GitHub Desktop.
How I doge.
(defun doge-ify (&rest phrases)
(let ((uc-ws #x2001)
(prefixes '("such" "wow" "wow such" "much" "very" "so" "too" "super" "amaze" ))
(fillers '("wow" "amaze" "good job" "super" "fancy" "woof" "[amaze intensifies]" "[wow intensifies]")))
(cl-flet* ((n-spaces (n) (apply 'string (mapcar (lambda (c) (if (< 3 (random 10)) c ?\s )) (make-string n uc-ws))))
(random-space () (n-spaces (* 2 (+ 3 (random 10)))))
(random-prefix () (nth (random (length prefixes)) prefixes))
(random-filler () (nth (random (length fillers)) fillers)))
(reduce 'concat (mapcar (lambda (phrase)
(concat (random-prefix) (n-spaces 1) phrase (random-space)
(if (> 6 (random 10)) (concat (random-filler) (random-space)) "")))
phrases)
:initial-value (concat (random-filler) (random-space))))))
(doge-ify "automation")
"fancy                      super automation                       super                     "
(doge-ify "music" "groovy" "dance")
"[wow intensifies]           so music         good job           such groovy                       fancy                   wow such dance             "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment