Skip to content

Instantly share code, notes, and snippets.

@peterc

peterc/barf.rb Secret

Created August 1, 2012 22:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterc/2060adac0f9cf5fb9cf3 to your computer and use it in GitHub Desktop.
Save peterc/2060adac0f9cf5fb9cf3 to your computer and use it in GitHub Desktop.
barf
1.upto(100) do |i|
puts(if b = i * 8 / 5 & 7 and (i + 2) * 6 / 9 & 1 == 1
b == 0 ? "FizzBuzz" : "Fizz"
elsif b == 0
"Buzz"
else
i
end)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment