Re:Fizz Buzz codegolf challenge in 15 languages
by ollysb on Friday December 14, 2012 @12:44PM
(#4922138)
Bit confused by the ruby version. The signature you're given is:
I presumed this meant you were supposed to return a value of n, fizz, buzz or fizzbuzz for the value of n. When I tried to compile I got a score of 0 though. What are you supposed to do with the value of n, solve fizzbuzz for 1..n ?
[ Parent
| on HN ]
Re:Fizz Buzz codegolf challenge in 15 languages
by hallowtech on Friday December 14, 2012 @12:47PM
(#4922150)
In other languages n is the number between 1-100 passed into the method. The loop is outside of fizzbuzz_solve.
Re:Fizz Buzz codegolf challenge in 15 languages
by ollysb on Friday December 14, 2012 @12:49PM
(#4922160)
I presumed you just return the value and that the print was in the outer loop, seems you need to include the print statement in your method.