Created
January 27, 2013 01:12
-
-
Save mikezter/4645655 to your computer and use it in GitHub Desktop.
Fizzbuzz Golf
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
(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)) |
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
(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