diff --git a/README.md b/README.md index 117858a..9b883c6 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ fizzbuzz [![Build Status](https://travis-ci.org/ituring/fizzbuzz.png)](https://travis-ci.org/ituring/fizzbuzz) 本仓库供本书读者参考用,不接收任何形式的Pull Request,敬请谅解。 + +Pull request 请到 https://github.com/ituring/first-pr 。 diff --git a/fizzbuzz.rb b/fizzbuzz.rb new file mode 100644 index 0000000..f77910c --- /dev/null +++ b/fizzbuzz.rb @@ -0,0 +1,13 @@ +class Fizzbuzz + def calculate number + if number % 3 == 0 && number % 5 == 0 + 'fizzbuzz' + elsif number % 3 == 0 + 'fizz' + elsif number % 5 == 0 + 'buzz' + else + number + end + end +end \ No newline at end of file