Skip to content

Instantly share code, notes, and snippets.

@jacegu
Created December 29, 2010 20:50
Show Gist options
  • Save jacegu/759059 to your computer and use it in GitHub Desktop.
Save jacegu/759059 to your computer and use it in GitHub Desktop.
FizzBuzz kata solution for "lazy" developers
class FizzBuzzGame
def answer_for(number)
return 'fizzbuzz' if number % 3 == 0 and number % 5 == 0
return 'fizz' if number % 3 == 0
return 'buzz' if number % 5 == 0
number
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment