Skip to content

Commit

Permalink
Fizz 2 added
Browse files Browse the repository at this point in the history
  • Loading branch information
davwood committed Aug 27, 2013
1 parent 5dc2a57 commit 8352a09
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Fizz2.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
class Fizzling
def initialize
end

def fizz(i)

if i % 3 == 0 && i % 5 == 0
puts "FizzBuzz"
elsif i % 3 == 0
puts "Fizz"
elsif i % 5 == 0
puts "Buzz"
else
puts i
end
end
end

b = Fizzling.new
(1..100).each do |i|
b.fizz(i)
end



0 comments on commit 8352a09

Please sign in to comment.