taira120
February 22, 2018
140

# FizzBuzz code golf by ruby

FizzBuzz code golf for hiroshima.rb #062

## taira120

February 22, 2018

## Transcript

3. ### (1..100).each do |i| puts "#{i} " if i % 3

== 0 if i % 5 == 0 puts 'ﬁzzbuzz' next else puts 'ﬁzz' next end end if i % 5 == 0 puts 'buzz' next end end count 207

5. ### (1..100).each do |i| print "#{i} " if i % 3

== 0 puts i % 5 == 0 ? 'ﬁzzbuzz' : 'ﬁzz' next end puts i % 5 == 0 ? 'buzz' : nil end count 148

7. ### (1..100).each do |i| print "#{i} " puts i % 3

== 0 ? i % 5 == 0 ? 'ﬁzzbuzz' : 'ﬁzz' : i % 5 == 0 ? 'buzz' : nil end count 122

9. ### (1..100).each { |i| print "#{i} " puts i % 3

== 0 ? i % 5 == 0 ? 'ﬁzzbuzz' : 'ﬁzz' : i % 5 == 0 ? 'buzz' : nil } count 119

11. ### (1..100).each { |i| print "#{i} ";puts i % 3 ==

0 ? i % 5 == 0 ? 'ﬁzzbuzz' : 'ﬁzz' : i % 5 == 0 ? 'buzz' : nil } count 115

13. ### (1..100).each { |i| print "#{i} “; puts i % 3

== 0 ? i % 5 == 0 ? 'ﬁzzbuzz' : 'ﬁzz' : i % 5 == 0 ? 'buzz' : '' } count 114

15. ### (1..100).each { |i| puts "#{i} #{'ﬁzz' if i % 3

== 0}#{'buzz' if i % 5 == 0}" } count 81

17. ### 1.upto(100) { |i| puts "#{i} #{'ﬁzz' if i % 3

== 0}#{'buzz' if i % 5 == 0}" } count 79

19. ### 1.upto(100) { |i| puts "#{i} #{'ﬁzz' if i % 3

< 1}#{'buzz' if i % 5 < 1}" } count 77