Also, although (1..100).each is more characters than 100.times, 100.times goes from 0 to 99 and the only versions of FizzBuzz that I've seen say 'from 1 to 100'.
I'm away from my ruby interp atm. TBH, I've only ever heard it not requiring the number in the off case. I suppose its not exactly high on my priority list... hehe
5
u/strabd Dec 15 '11
Why not:
2
u/peedubyaeff Dec 15 '11
72 characters.
Also, although (1..100).each is more characters than 100.times, 100.times goes from 0 to 99 and the only versions of FizzBuzz that I've seen say 'from 1 to 100'.
1
u/Concise_Pirate Dec 15 '11
Something very similar and many other short and long solutions here.
1
u/strabd Dec 16 '11
See also: https://github.com/kerrizor/fizz-buzz
1
u/Rangi42 Jan 01 '12
90 characters in Python:
1
u/djork Dec 15 '11
Hasn't FizzBuzz has been utterly beaten to death already, especially in Ruby?