class Messages
Public Instance Methods
blue()
click to toggle source
# File lib/messages.rb, line 65 def blue "(b)lue".blue end
color_match(color_match)
click to toggle source
# File lib/messages.rb, line 45 def color_match(color_match) "You have #{color_match} of the correct #{colors}" end
colors()
click to toggle source
# File lib/messages.rb, line 53 def colors "c".red + "o".yellow + "l".blue + "o".green + "r".red + "(s)".yellow end
command_request()
click to toggle source
# File lib/messages.rb, line 24 def command_request "MAIN MENU: Enter a command[(q)uit, (i)nstructions, or (p)play] : " end
duration(minutes, seconds, tries)
click to toggle source
# File lib/messages.rb, line 41 def duration(minutes, seconds, tries) "It took you #{tries} tries over #{minutes} minutes and #{seconds} seconds to finish." end
ending()
click to toggle source
# File lib/messages.rb, line 69 def ending "Good bye." end
game_command_request()
click to toggle source
# File lib/messages.rb, line 78 def game_command_request "Enter colors (or 'q' for quit):" end
game_instructions()
click to toggle source
# File lib/messages.rb, line 28 def game_instructions puts "Once the game begins, a secret code will be generated consisting of 4 elements, "\ "#{red}, #{yellow}, #{green}, #{blue}. This code will be hidden from you."\ " Your task is to guess the code in the least number of trys.\nAlong the way,"\ "you will be given hints about the code, until you guess the correct code.\n"\ "Guess wisely, he who has the least amount of guesses wins!\n The code consists of 4 elements: " end
game_intro()
click to toggle source
# File lib/messages.rb, line 73 def game_intro "I have generated a beginner sequence with four elements made up of:"\ "#{red},#{green}, #{blue}, and #{yellow}." end
green()
click to toggle source
# File lib/messages.rb, line 61 def green "(g)reen".green end
intro()
click to toggle source
# File lib/messages.rb, line 6 def intro print "\e[2J\e[f" puts' _____ __ .__ .___ '.magenta puts' / \ _____ _______/ |_ ___________ _____ |__| ____ __| _/ '.magenta puts' / \ / \__ \ / ___/\ __\/ __ \_ __ \/ \| |/ \ / __ | '.magenta puts' / Y \/ __ \_\___ \ | | \ ___/| | \/ Y Y \ | | \/ /_/ | '.magenta puts' \____|__ (____ /____ > |__| \___ >__| |__|_| /__|___| /\____ | '.magenta puts' \/ \/ \/ \/ \/ \/ \/ '.magenta puts "\n" + program_instructions end
no_match()
click to toggle source
# File lib/messages.rb, line 98 def no_match "NOT A MATCH".magenta end
not_valid_input()
click to toggle source
# File lib/messages.rb, line 90 def not_valid_input "Input not valid. Please enter (r)ed, (g)reen, (b)lue, or (y)ellow" end
position_color_match(position_color_match)
click to toggle source
# File lib/messages.rb, line 49 def position_color_match(position_color_match) puts "you have #{position_color_match} #{colors} in the correct position" end
program_instructions()
click to toggle source
# File lib/messages.rb, line 20 def program_instructions "To Play Enter '(p)lay', For Instructions Enter '(i)nstructions', To Quit At Anytime Enter '(q)uit' " end
quit_game()
click to toggle source
# File lib/messages.rb, line 86 def quit_game "Exiting game. Press 'q' to quit" end
red()
click to toggle source
# File lib/messages.rb, line 37 def red "(r)ed".red end
too_long()
click to toggle source
# File lib/messages.rb, line 106 def too_long "The code you entered is too long." end
too_short()
click to toggle source
# File lib/messages.rb, line 102 def too_short "The code you entered is too short." end
try_indicator(tries)
click to toggle source
# File lib/messages.rb, line 82 def try_indicator(tries) "This is try number #{tries}" end
winner()
click to toggle source
# File lib/messages.rb, line 94 def winner "YOU".red + " WON".blue + "!!!".green + "!!!".yellow end
yellow()
click to toggle source
# File lib/messages.rb, line 57 def yellow "(y)ellow".yellow end