Skip to main content

Timeline for FizzBuzz in Ruby

Current License: CC BY-SA 3.0

19 events
when toggle format what by license comment
Apr 13, 2017 at 12:40 history edited CommunityBot
replaced http://codereview.stackexchange.com/ with https://codereview.stackexchange.com/
Jul 15, 2014 at 8:40 comment added tokland I'd move the puts to the each block. More modular, less repetition.
Jul 14, 2014 at 22:52 vote accept CommunityBot
Jul 13, 2014 at 20:00 comment added Engineer2021 Break it out of the case statements and you can make the code smaller. gist.github.com/wilkinsbrian/e6fc05fbd6ab96e87cd0
Jul 13, 2014 at 19:19 history edited RubberDuck CC BY-SA 3.0
deleted 22 characters in body
Jul 13, 2014 at 19:03 comment added Flambino Ah, yup, there we go, the very instant I posted my last comment :)
Jul 13, 2014 at 19:02 comment added Flambino Trouble is that your divisibleBy* variables will always be thruth'y; they'll never be nil or false. So the code always prints "FizzBuzz" regardless of the number you pass it. You have to compare them against zero somewhere
Jul 13, 2014 at 19:02 comment added RubberDuck Never mind. Figured out my mistake. It should be all good now.
Jul 13, 2014 at 19:01 history edited RubberDuck CC BY-SA 3.0
added 10 characters in body
Jul 13, 2014 at 18:40 comment added RubberDuck @Flambino. I fixed everything except the &&. I got that from OP's code and don't know how to fix it.
Jul 13, 2014 at 18:36 history edited RubberDuck CC BY-SA 3.0
deleted 9 characters in body
Jul 13, 2014 at 18:07 comment added Schism It would be fun to extend Integer to hold the divisibleBy3? and divisbleBy5? methods.
Jul 13, 2014 at 16:59 comment added RubberDuck My Ruby n00b is showing I guess. I'll look at it again later.
Jul 13, 2014 at 16:58 comment added Flambino I'm afraid there's a lot more here. 1) only methods can have ? in their name, 2) but even if it worked, divisibleBy3? && divisibleBy5? will always be true since neither will ever be false'y, and 3) using do and {} for the last block is a syntax error...
Jul 13, 2014 at 16:58 history edited RubberDuck CC BY-SA 3.0
edited body
Jul 13, 2014 at 16:50 comment added Flambino A PascalCased method name? My Ruby-sense is tingling...
Jul 13, 2014 at 16:32 history edited RubberDuck CC BY-SA 3.0
added 194 characters in body
Jul 13, 2014 at 16:05 comment added user25840 The program was originally built to be code golf, and thus the odd variable names. But I've still learnt something today, thanks!
Jul 13, 2014 at 16:01 history answered RubberDuck CC BY-SA 3.0