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

fizzbuzz

Name: Anonymous 2011-01-28 20:49

(define (main num)
  (if (= num 100) (exit))
  (set! tmp (modulo num 15))
  (if (or (= tmp 1) (= tmp 2) (= tmp 4) (= tmp 7) (= tmp 8) (= tmp 11) (= tmp 13) (= tmp 14))
      (display num)
      (begin
        (if (or (= tmp 3) (= tmp 6) (= tmp 9) (= tmp 0) (= tmp 12)) (display "Fizz"))
        (if (or (= tmp 5) (= tmp 10) (= tmp 0)) (display "Buzz"))))
  (newline)
  (main (+ num 1)))
(define tmp 0)
(main 1)

can you do better?

Name: Anonymous 2011-01-29 11:39


if fb:"$(x.{?%3==0  -> say "Fizz"{)$(x.{?%5==0 -> say "Buzz"})" != ""
  then fb
  else x

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