5 ms·
The challenge is insufficiently specified. What sort of spacing am I supposed to put between the number, fizz/buzz, and the next answer? A space? A colon and a
by sukuriant 15y ago
The challenge is insufficiently specified. What sort of spacing am I supposed to put between the number, fizz/buzz, and the next answer? A space? A colon and a space? Does it matter?
I don't know ruby, so I didn't make a response, but these things should be spelled out.
- esrauch 15y agoIt specifies in the comment that you should use puts, which includes a newline between entries in ruby.
- dangrossman 15y agoIt's not a formal specification, but if you just do what the comments in the code say to do ("puts" fizz/buzz/fizzbuzz/#), that's the passing answer. I don't know Ruby either, so I looked up the syntax for a for loop, guessed at the conditional (elseif vs elsif vs else if) and used puts for output... and that was all it takes to pass the little test.
- marquis 15y agoI just spend the last 30 minutes to learn enough Ruby to pass the test. There are many ways to do this to get it to pass. Thank heavens for modulo, however.
- dangrossman 15y agoIt's simple without modulo too. Division's just repeated subtraction, so subtract 3 or 5 until you hit 0... if you pass it, it wasn't evenly divisible. Multiple loops instead of one.
- mindstab 15y agoIf you submit it it runs a comparison below and shows what you output and what it's looking for