Created
December 18, 2014 05:36
-
-
Save yuchan/401617de9e10d78d356b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(setq a "nothacker") ; => "nothacker" | |
(cond | |
((eq a "hacker") 'foo) | |
(t "default")) ; => "default" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(setq num 0) ; => 0 | |
(while (< num 4) | |
(princ (format "Iteration %d." num)) | |
(setq num (1+ num)) | |
) ; => nil | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(+ 3 4) ; => 7 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment