Skip to content

Instantly share code, notes, and snippets.

@nickfun
Created July 6, 2015 22:02
Show Gist options
  • Save nickfun/93132fb1ed84f052fb43 to your computer and use it in GitHub Desktop.
Save nickfun/93132fb1ed84f052fb43 to your computer and use it in GitHub Desktop.
;;
;; FizzBuzz in emacs lisp
;;
(defun nf/fb (num)
(cond
((and
(= 0 (% num 3))
(= 0 (% num 5))) "fizzbuzz")
((= 0 (% num 3)) "fizz")
((= 0 (% num 5)) "buzz")
(t (number-to-string num))))
(progn
(setq-local i 1)
(while (< i 19)
(print (nf/fb i))
(setq-local i (+ i 1))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment