Skip to content

Instantly share code, notes, and snippets.

@frankramosdev
Created September 11, 2012 11:14
Show Gist options
  • Save frankramosdev/3697661 to your computer and use it in GitHub Desktop.
Save frankramosdev/3697661 to your computer and use it in GitHub Desktop.
Ping pong
(1..100).each{|i|
x = ''
x += 'ping' if i%5==0
x += 'pong' if i%7==0
puts(x.empty? ? i : x);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment