Last active
August 29, 2015 14:18
-
-
Save loganhasson/3d4f43d3afdbf601693b to your computer and use it in GitHub Desktop.
Revisions
-
loganhasson revised this gist
Apr 1, 2015 . 1 changed file with 27 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,6 @@ ;;;; Two very similar versions of fizzbuzz ;;; Will break if n is not a number (defun fizzbuzz (n) (let ((x (read-from-string n))) (cond @@ -12,4 +15,28 @@ ) ) ) ) ;;; Will not break if n is not a number (defun fizzbuzz (n) (let ((x (read-from-string n))) (cond ((eq (typep x 'integer) T) (cond ((eq (mod x 15) 0) "FizzBuzz" ) ((eq (mod x 5) 0) "Buzz" ) ((eq (mod x 3) 0) "Fizz" ) ) ) (t "Not a number." ) ) ) ) -
loganhasson created this gist
Apr 1, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ (defun fizzbuzz (n) (let ((x (read-from-string n))) (cond ((eq (mod x 15) 0) "FizzBuzz" ) ((eq (mod x 5) 0) "Buzz" ) ((eq (mod x 3) 0) "Fizz" ) ) ) )