Skip to content

Instantly share code, notes, and snippets.

@dacamp
Created September 26, 2013 09:00
Show Gist options
  • Save dacamp/6711646 to your computer and use it in GitHub Desktop.
Save dacamp/6711646 to your computer and use it in GitHub Desktop.
Obfuscated Fizz Buzz
#!/usr/bin/env ruby
# Fuzz you fizzbuzz
#
def method_missing(m, arg, &block)
[arg, m.to_s.split('_').select{|e|
(arg%(((e.to_s.bytes.
inject{ |sum, i| sum + i } % 15) / 3.0
).ceil + 2)).zero?
}.join()].join(' ')
end
((ARGV.any? || ARGV = (1..1000)) && ARGV).each do |a|
puts fizz_buzz(a.to_i)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment