Created
June 7, 2017 04:14
-
-
Save 0x6d61/623068cc93964d6fbec81df6f3709569 to your computer and use it in GitHub Desktop.
fizzbuzz
This file contains 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 range(n m) | |
(if (> n m) | |
() | |
(cons n (range (+ n 1) m) | |
) | |
) | |
) | |
(defun fizzbuzz(i) | |
(cond ((eq 0 (mod i 3)) (print "Fizz")) | |
((eq 0 (mod i 5)) (print "Buzz")) | |
((eq 0 (mod i 15)) (print "FizzBuzz")) | |
(t (print i)) | |
) | |
) | |
(mapcar #'fizzbuzz (range 1 100)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment