DEV Community

loading...

Discussion on: FizzBuzz challenge in as many languages as possible

Collapse
mattonem profile image
maxmattone • Edited

Language: Emacs Lisp
Code:

(cl-defun fizzbuzz(&optional (n 100))
  (cl-loop for i from 1 to n do
       (print
        (cond ((= (mod i 15) 0) "FizzBuzz")
          ((= (mod i 3) 0) "Fizz")
          ((= (mod i 5) 0) "Buzz")
          (t i)
         ))
       ))
(fizzbuzz)