September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
16
Task/FizzBuzz/Common-Lisp/fizzbuzz-7.lisp
Normal file
16
Task/FizzBuzz/Common-Lisp/fizzbuzz-7.lisp
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
(defun core (x)
|
||||
(mapcar
|
||||
#'(lambda (a b) (if (equal 0 (mod x a)) b x))
|
||||
'(3 5)
|
||||
'("fizz" "buzz")))
|
||||
|
||||
(defun filter-core (x)
|
||||
(if (equal 1 (length (remove-duplicates x)))
|
||||
(list (car x))
|
||||
(remove-if-not #'stringp x)))
|
||||
|
||||
(defun fizzbuzz (x)
|
||||
(loop for a from 1 to x do
|
||||
(print (format nil "~{~a~}" (filter-core (core a))))))
|
||||
|
||||
(fizzbuzz 100)
|
||||
Loading…
Add table
Add a link
Reference in a new issue