Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

FizzBuzz

Name: Anonymous 2011-08-31 2:15

(defun fizz-buzz (start end)
  (loop for x from start to end do
       (let ((3? (= (mod x 3) 0))
         (5? (= (mod x 5) 0)))
     (when 3?             (format t "Fizz"))
     (when 5?          (format t "Buzz"))
     (unless (or 3? 5?) (format t "~a" x))
     (terpri))))


What does /b/ think?

Name: Anonymous 2011-08-31 5:38

#include <stdio.h>
#include <stdlib.h>

main(int argc, char** argv)
{
    printf(argc % 3 == 0 ? argc % 5 == 0 ? "FizzBuzz\n" : "Fizz\n" : argc % 5 == 0 ? "Buzz\n" : "%d\n", argc);
    if(argc < 100) main(argc + 1, 0); else return 0;
    getchar();
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List