Skip to content

Instantly share code, notes, and snippets.

@0x6d61
Created June 7, 2017 04:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 0x6d61/623068cc93964d6fbec81df6f3709569 to your computer and use it in GitHub Desktop.
Save 0x6d61/623068cc93964d6fbec81df6f3709569 to your computer and use it in GitHub Desktop.
fizzbuzz
(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