Created
June 14, 2013 22:59
-
-
Save jaredsmithse/5785947 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
module PrintDialogue | |
def game_start | |
puts "Welcome to Flash Cards with Friends!" | |
puts "Type 'exit' if you feel you're in over your head." | |
print "Type 'answer' if you know you will never get it.\n\n" | |
end | |
def correct_answer | |
print "Correct! You're not as dumb as you look...\n\n" | |
end | |
def wrong_answer | |
puts "Wow, how do you not know this?" | |
puts "I'll let you try again because I feel bad for you..." | |
end | |
def naughty_words | |
puts "Don't be mean, I don't like you either." | |
print "Everything is logged and posted to Socrates. I win.\n\n" | |
end | |
def gave_up | |
puts "You should just give up on life, but here is your answer." | |
end | |
end | |
def play_game | |
play_card | |
while true | |
if @current_card.is_answer?(@input) | |
correct_answer | |
play_card | |
elsif @input == "answer" | |
gave_up | |
@current_card.print_answer | |
play_card | |
elsif @input == "fuck you" | |
naughty_words | |
@input = gets.chomp | |
elsif @input == "exit" | |
break | |
else | |
wrong_answer | |
@wrong_limit += 1 | |
@wrong_limit >= 3 ? play_card : @input = gets.chomp | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment