29.10.11

at least someone is recursing

best programming sample (its been a while since I liked some code)

(defun fizzbuzz (n)
(when ( n 0)
(fizzbuzz (- n 1))
(format t "~a~%"
(if (= (mod n 3) 0)
(if (= (mod n 5) 0) "FizzBuzz" "Fizz")
(if (= (mod n 5) 0) "Buzz" n)))))

(progn (fizzbuzz 100) (values))
Sean on February 27, 2007 6:11 AM

http://www.codinghorror.com/blog/2007/02/why-cant-programmers-program.html

Δεν υπάρχουν σχόλια: