Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The Ruby example that you recommending hiring because of, is overkill. Here is a better Ruby example:

    (1..100).each do |i|
      o = ""
      o.concat("Fizz") if i % 3 == 0  
      o.concat("Buzz") if i % 5 == 0  
      o.concat("Bazz") if i % 7 == 0  
      o.concat(i.to_s) if o.empty?  
      puts o
    end


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: