Skip to content

Instantly share code, notes, and snippets.

@alexispurslane
Last active August 29, 2015 14:01
Show Gist options
  • Save alexispurslane/2d4536fda36794f830fb to your computer and use it in GitHub Desktop.
Save alexispurslane/2d4536fda36794f830fb to your computer and use it in GitHub Desktop.
FizzBuzz in Racket
#lang racket
(define (fizz-buzz [end 100] [n 1])
(letrec ([FB (lambda (n)
(cond
((< n end)
(displayln
(match (gcd n 15)
[15 "fizzbuzz"]
[3 "fizz"]
[5 "buzz"]
[_ n]))
(FB (add1 n)))))])
(FB n)))
@alexispurslane
Copy link
Author

Obeys all the commandments from the seasoned schemer!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment