Last active
May 20, 2016 07:11
-
-
Save TheNotary/9dc70719716e0d03a1d2dcb7eecf50c8 to your computer and use it in GitHub Desktop.
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
match(/guess (\S+)/, method: :guess) | |
def guess(m, guessed_word) | |
result = @game.guess(guessed_word) | |
reply = case result | |
when :missed_north | |
"My word comes after #{guessed_word}." | |
when :missed_south | |
"My word comes before #{guessed_word}." | |
when :correct | |
"#{m.user}: congratulations, that's the word! You win!" | |
when :not_a_word | |
"#{m.user}: sorry, #{guessed_word} isn't a word. At least, as far as I know" | |
when :no_game | |
"You haven't started a game yet. Use `!word start` to do that." | |
end | |
m.reply reply | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment