Last active
August 29, 2015 14:01
-
-
Save alexispurslane/2d4536fda36794f830fb to your computer and use it in GitHub Desktop.
FizzBuzz in Racket
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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))) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Obeys all the commandments from the seasoned schemer!