Skip to content

Instantly share code, notes, and snippets.

@verdammelt
verdammelt / raindrops-do.lisp
Last active Sep 27, 2015
raindrops implementation
View raindrops-do.lisp
(defun convert (n &optional (cases '((3 . "Pling") (5 . "Plang") (7 . "Plong"))))
(let ((results
(do* ((cs cases (cdr cs))
(c (car cs) (car cs))
(result (list)))
((null cs) (reverse result))
(when (zerop (mod n (car c)))
(push (cdr c) result)))))
(if results
(apply #'concatenate 'string results)
@verdammelt
verdammelt / gist:2417ee8be3802593d434
Last active Aug 29, 2015
beer song implemented (nearly) as a single FORMAT statement.
View gist:2417ee8be3802593d434
(defun verse (start &optional (end start))
(format nil
"~:{~[~
No more bottles of beer on the wall, ~
no more bottles of beer.~%~
Go to the store and buy some more, ~
99 bottles of beer on the wall.~%~%~
~:;~
View gist:10010154
### Keybase proof
I hereby claim:
* I am verdammelt on github.
* I am mjs (https://keybase.io/mjs) on keybase.
* I have a public key whose fingerprint is D16A F8CC 8AF0 D147 C238 F16F AC7E 42A3 C864 6D6D
To claim this, I am signing this object: