module Message
Public Instance Methods
begin_prompt()
click to toggle source
# File lib/femis_hangman/message.rb, line 14 def begin_prompt "Let the games begin\n\n" end
duplicate_prompt(letter)
click to toggle source
# File lib/femis_hangman/message.rb, line 103 def duplicate_prompt(letter) "You have used the letter #{letter} already" end
empty_prompt()
click to toggle source
# File lib/femis_hangman/message.rb, line 99 def empty_prompt "You haven't used any letters yet." end
feedback_prompt()
click to toggle source
# File lib/femis_hangman/message.rb, line 86 def feedback_prompt "Choose your feedback type\n\n1: Boring\n2: Funny\n" end
game_instruction_prompt()
click to toggle source
def help_prompt <<-HELP
Press: hangman - to start the hangman game resume ‘game id` - to resume saved game
HELP end
# File lib/femis_hangman/message.rb, line 131 def game_instruction_prompt <<-PUTS Press ':h' or 'history' to view the letters you have used Press ':q' or 'quit' to quit (you can save before quiting) PUTS end
instructions_prompt()
click to toggle source
# File lib/femis_hangman/message.rb, line 18 def instructions_prompt <<-PUTS ######################################################## Attempt to guess the missing letters correctly. You have a limited number of tries. If you use up all your chances without getting the word correctly, you will be hanged. To play a new game: Press 'p' or 'play' To load a saved game: Press 'l' or 'load' To show instructions: Press 'i' or 'instructions' To quit Hangman: Press 'q' or 'quit' ######################################################## PUTS end
invalid_game_prompt()
click to toggle source
# File lib/femis_hangman/message.rb, line 119 def invalid_game_prompt 'There is no game with such ID' end
invalid_prompt()
click to toggle source
# File lib/femis_hangman/message.rb, line 95 def invalid_prompt 'Invalid entry!' end
level_prompt()
click to toggle source
# File lib/femis_hangman/message.rb, line 82 def level_prompt "Choose your difficulty level\n\n1: Beginner\n2: Intermediate\n3: Advanced\n" end
load_prompt()
click to toggle source
# File lib/femis_hangman/message.rb, line 10 def load_prompt "Choose the game you want to resume from the list below\nPress the respective number" end
lost_gui(word)
click to toggle source
# File lib/femis_hangman/message.rb, line 48 def lost_gui(word) <<-HEREDOC -+----------+- | | | o | /|\\ | / \\ | | | You are dead! ################ The word is #{word} ################ HEREDOC end
lost_prompt(word)
click to toggle source
# File lib/femis_hangman/message.rb, line 40 def lost_prompt(word) "You are dead!\nThe word is #{word}\nPress any key to continue or 'q' to quit" end
print_text(text)
click to toggle source
# File lib/femis_hangman/message.rb, line 111 def print_text(text) "#{text}" end
replay_prompt()
click to toggle source
# File lib/femis_hangman/message.rb, line 91 def replay_prompt "Press 'r' or 'restart' to play again\nPress 'q' to quit\n" end
save_prompt()
click to toggle source
# File lib/femis_hangman/message.rb, line 36 def save_prompt "Press 's' or 'save' to save before quiting\nPress 'q' to quit anyway" end
size_prompt(size)
click to toggle source
# File lib/femis_hangman/message.rb, line 6 def size_prompt(size) "Your word is a #{size} letter word" end
thanks_prompt()
click to toggle source
# File lib/femis_hangman/message.rb, line 115 def thanks_prompt 'Thank you for playing!' end
turns_prompt(turns)
click to toggle source
# File lib/femis_hangman/message.rb, line 107 def turns_prompt(turns) "You have #{turns} turns left" end
welcome_prompt()
click to toggle source
# File lib/femis_hangman/message.rb, line 2 def welcome_prompt 'Welcome to Hangman. Guess right or get hanged!' end
won_gui(word)
click to toggle source
# File lib/femis_hangman/message.rb, line 65 def won_gui(word) <<-HEREDOC -+----------+- | | | | | o/ | /| | \\/ \\ | / You are free to go ################ The word is #{word} ################ HEREDOC end
won_prompt(word)
click to toggle source
# File lib/femis_hangman/message.rb, line 44 def won_prompt(word) "You win!\nThe word is #{word}" end