Skip to content

Instantly share code, notes, and snippets.

@zaru
Created December 17, 2014 01:36
Show Gist options
  • Select an option

  • Save zaru/d02f9fd01a09dcbb917a to your computer and use it in GitHub Desktop.

Select an option

Save zaru/d02f9fd01a09dcbb917a to your computer and use it in GitHub Desktop.
CommonLispでFizzBuzz
(defun fizzbuzz()
(dotimes (n 1000000)
(defparameter *a* (+ n 1))
(cond
((equal(mod *a* 15) 0) (print "FizzBuzz"))
((equal(mod *a* 5) 0) (print "Buzz"))
((equal(mod *a* 3) 0) (print "Fizz"))
(1 (print *a*))
)))
(ccl:save-application "fizzbuzz"
:toplevel-function #'fizzbuzz
:prepend-kernel t)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment