Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #5 from katorie/fizz-buzz
Browse files Browse the repository at this point in the history
map is useful
  • Loading branch information
katorie committed Aug 17, 2015
2 parents 61d5416 + d0979d7 commit 6230eac
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions array/blocks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,13 @@ def lookup_mail_addresses2(table, logins)
def fizz_buzz2(seq)
seq.map {|n|
if n % 3 == 0 && n % 5==0
result << "Fizz Buzz"
"Fizz Buzz"
elsif n % 3 == 0
result << "Fizz"
"Fizz"
elsif n % 5 == 0
result << "Buzz"
"Buzz"
else
result << n
n
end
}
end
Expand Down

0 comments on commit 6230eac

Please sign in to comment.