/fizzbuzz

Fizzbuzz implementations for fun and small syntax reference...

Primary LanguageShellMIT LicenseMIT

Fizzbuzzes

This repo holds my fizzbuzzes in different languages. Just for fun, and to remind me of different syntaxes available.

To recap, fizzbuzz definition:

Print out numbers from 1 to 100. If the number is divisible by 3, print out "Fizz" instead. If the number is divisible by 5, print out "Buzz". If the number is divisible by both 3 and 5, print "FizzBuzz".

And here are some clarifications, that "should" be clear from given definition but sometimes do not seem to:

  • if the number is divisible by either 3 or 5 (or both), do not print the number. (This should be implied by the "instead".)
  • "from 1 to 100" means integer numbers 1...100, including the endpoints. Note that it does NOT start from 0 and it does include 100.

It seems this is something that can hit you in an interview, even though it really is dead-simple to anyone who knows at least little bit of programming. If you can't solve this problem, you really do NOT know how to program...

License

Honestly, fizzbuzz is so trivial these should not be copyrightable work. Yet, it seems everyone needs to be anal about these things, so it's MIT license here. If you happen to solve the problem in exact same verbatim way by yourself, I will never sue you for not complying with this license.