Tagged: FizzBuzz

The Mystery of the One-Line FizzBuzz

The Mystery of the One-Line FizzBuzz

I’ve written FizzBuzz in Javascript a few times, but never in Ruby until today. My code was as follows: We were printing numbers from 1 through 100 so I had the code loop 101 times, skipping the first number (which was 0), and then checking to see if numbers were divisible by 15, 3, and 5. If divisible by 3, I had...