Last active
May 16, 2019 06:55
-
-
Save louiee/6ba72def131a10f43f3d334f10577602 to your computer and use it in GitHub Desktop.
Fizzbuzz gauche
This file contains 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
#!/usr/local/bin/gosh | |
(define fizzbuzz | |
(lambda (x) | |
(if (> x 1) (fizzbuzz (- x 1)) | |
(cond | |
((= (modulo x 15) 0) (display x ":FizzBuzz")) | |
((= (modulo x 3) 0) (display x ":Fizz")) | |
((= (modulo x 5) 0) (display x ":Buzz")) | |
(else (display x)) | |
) | |
) | |
) | |
(define (main args) | |
(fizzbuzz 30) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment