Skip to content

Instantly share code, notes, and snippets.

@yuchan
Created December 18, 2014 05:36
Show Gist options
  • Save yuchan/401617de9e10d78d356b to your computer and use it in GitHub Desktop.
Save yuchan/401617de9e10d78d356b to your computer and use it in GitHub Desktop.
(defun fizzbuzz (n)
(cond
((= (% n 15) 0) "FizzBuzz")
((= (% n 5) 0) "Buzz")
((= (% n 3) 0) "Fizz")
(t n))) ; => fizzbuzz
(fizzbuzz 10) ; => "Buzz"
(fizzbuzz 2) ; => 2
(setq a "nothacker") ; => "nothacker"
(cond
((eq a "hacker") 'foo)
(t "default")) ; => "default"
(setq num 0) ; => 0
(while (< num 4)
(princ (format "Iteration %d." num))
(setq num (1+ num))
) ; => nil
(+ 3 4) ; => 7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment