5 ms·
Bit confused by the ruby version. The signature you're given is: #!/bin/ruby # Head ends here def fizzbuzz_solve n end # Tail starts her
by ollysb 14y ago
Bit confused by the ruby version. The signature you're given is:
#!/bin/ruby
# Head ends here
def fizzbuzz_solve n
end
# Tail starts here
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 ?
- hallowtech 14y agoIn other languages n is the number between 1-100 passed into the method. The loop is outside of fizzbuzz_solve.
- 4ngle 14y agoThe boilerplate (include the shebang) counts towards your score, so just ditch it and start anew.