Skip to content

Instantly share code, notes, and snippets.

@louiee
Last active May 16, 2019 06:55
Show Gist options
  • Save louiee/6ba72def131a10f43f3d334f10577602 to your computer and use it in GitHub Desktop.
Save louiee/6ba72def131a10f43f3d334f10577602 to your computer and use it in GitHub Desktop.
Fizzbuzz gauche
#!/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