Created
October 31, 2011 02:58
-
-
Save hyoshiok/1326806 to your computer and use it in GitHub Desktop.
fizzbuzz in Ruby
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
# | |
# fizzbuzz | |
# author: hirotaka.yoshioka@mail.rakuten.com | |
# 10/31/2011 | |
# | |
fz = ["fizzbuzz", 1, 2, "fizz", 4, "buzz", "fizz", 7, 8, "fizz", | |
"buzz", 11, "fizz", 13, 14] | |
(1..30).each {|i| p fz[i%15].class == String ? fz[i%15] : i} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment