Skip to content

Instantly share code, notes, and snippets.

@VoQn
Created September 10, 2010 04:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save VoQn/573114 to your computer and use it in GitHub Desktop.
Save VoQn/573114 to your computer and use it in GitHub Desktop.
FizzBuzz(3の倍数ならFizz, 5の倍数ならBuzz, 15の倍数ならFizzBuzzに文字を置換する問題のアレ)
;; Shortest? FizzBuzz
(use srfi-1)
(let1 ? (.$ zero? (pa$ mod))
(for-each
(.$ print (^i (cond [(? i 15) 'FizzBuzz]
[(? i 5) 'Buzz]
[(? i 3) 'Fizz]
[else i])))
(cdr (iota 101))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment