Skip to content

Instantly share code, notes, and snippets.

@mikezter
Created January 27, 2013 01:12
Show Gist options
  • Save mikezter/4645655 to your computer and use it in GitHub Desktop.
Save mikezter/4645655 to your computer and use it in GitHub Desktop.
Fizzbuzz Golf
(defun m (x i) (= 0 (mod x i)))
(defun fibu (x)
(cond
((m x 15) "FizzBuzz")
((m x 3) "Fizz")
((m x 5) "Buzz")))
(loop for i from 1 to 100 do
(princ (or (fibu i) i))
(princ #\newline))
(defun m (x i) (= 0 (mod (+ x 1) i)))
(dotimes (i 100)
(princ (cond
((m i 15) "FizzBuzz")
((m i 3) "Fizz")
((m i 5) "Buzz")
(t (+ i 1))))
(princ #\newline))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment