-
-
Save dacamp/6711646 to your computer and use it in GitHub Desktop.
Obfuscated Fizz Buzz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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