Skip to content

Instantly share code, notes, and snippets.

@capoferro
Created November 3, 2011 23:00
Show Gist options
  • Save capoferro/1338198 to your computer and use it in GitHub Desktop.
Save capoferro/1338198 to your computer and use it in GitHub Desktop.
(1..100).each do |n|
out = ''
out += 'foo' if n % 3 == 0
out += 'bar' if n % 5 == 0
puts out.empty? ? n : out
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment