Skip to content

Instantly share code, notes, and snippets.

@gclaramunt
Created June 22, 2010 03:33
Show Gist options
  • Save gclaramunt/447901 to your computer and use it in GitHub Desktop.
Save gclaramunt/447901 to your computer and use it in GitHub Desktop.
(define divisible?
(lambda (a n)
(eq? (remainder a n) 0)
))
(define fizz-buzz
(lambda (i)
(cond
((eq? i 0) '0)
(else (cond
((and (divisible? i 3) (divisible? i 5)) (display '"FizzBuzz"))
((divisible? i 3) (display '"Fizz"))
((divisible? i 5) (display '"Buzz"))
(else (display i))
) (display '" ") (fizz-buzz (- i 1)) )
)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment