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
(loop :for n :from 1 :below 1000 | |
:when (or (zerop (mod n 3)) | |
(zerop (mod n 5))) | |
:sum n) |
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
;; Discovered via http://www.adampetersen.se/articles/fizzbuzz.htm | |
;; “Write a program that prints the numbers from 1 to 100. But for | |
;; multiples of three print “Fizz” instead of the number and for the | |
;; multiples of five print “Buzz”. For numbers which are multiples of | |
;; both three and five print “FizzBuzz”.” | |
(defun multiple-p (n multiple) | |
(zerop (mod n multiple))) | |
(defun fizzbuzz () |