Last active
December 26, 2015 11:59
-
-
Save tenten0213/7148083 to your computer and use it in GitHub Desktop.
HubotにFizzBuzzを答えさせる
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
# Description: | |
# hubot answer the FizzBuzz Question | |
# | |
# Commands: | |
# hubot fizzbuzz N - Reply result of FizzBuzz | |
module.exports = (robot) -> | |
robot.respond /fizzbuzz( (\d+))?/i, (msg) -> | |
count = msg.match[2] || 100 | |
msg.send ['Fizz' unless i%3] + ['Buzz' unless i%5] or i for i in [1..count] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment