Skip to content

Instantly share code, notes, and snippets.

@curegit
Created April 2, 2019 04:43
Show Gist options
  • Save curegit/5c10c16651549292a3d146ceba814b6b to your computer and use it in GitHub Desktop.
Save curegit/5c10c16651549292a3d146ceba814b6b to your computer and use it in GitHub Desktop.
Common Lisp で FizzBuzz
(defun fizzbuzz (n)
(loop for i from 1 to n
do (cond ((equal (mod i 15) 0) (format t "~%fizzbuzz"))
((equal (mod i 5) 0) (format t "~%buzz"))
((equal (mod i 3) 0) (format t "~%fizz"))
(t (print i)))))
(defun fizzbuzz-main ()
(fizzbuzz 100))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment