Skip to content

Instantly share code, notes, and snippets.

@simple
Created July 8, 2011 03:05
Show Gist options
  • Save simple/1071036 to your computer and use it in GitHub Desktop.
Save simple/1071036 to your computer and use it in GitHub Desktop.
369 Game
(1..100).each do |num|
claps = 0
num.to_s.each_char { |c| claps += 1 if /[369]/.match(c) }
word = claps > 0 ? 'clap! ' * claps : num
print "#{word},"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment