module Codebreaker::Messages

Public Class Methods

bye() click to toggle source
# File lib/ep-codebreaker/messages.rb, line 62
def bye
  puts 'Good luck!'
end
hint(hint, hints_left, tries_left) click to toggle source
# File lib/ep-codebreaker/messages.rb, line 53
def hint(hint, hints_left, tries_left)
  if hint
    puts "Hint #{hint}.", "#{hints_left} hints_left."
    tries_left(tries_left)
  else
    puts 'No hints left.', "\n"
  end
end
lose(answer) click to toggle source
# File lib/ep-codebreaker/messages.rb, line 45
def lose(answer)
  puts 'Sorry, you lose(((', "It was #{answer}.", "\n"
end
play() click to toggle source
# File lib/ep-codebreaker/messages.rb, line 33
def play
  puts "Let's go! \n" \
       "\n" \
       "1 - hint  \n" \
       "0 - end   \n" \
       "\n"
end
run() click to toggle source
# File lib/ep-codebreaker/messages.rb, line 25
def run
  puts "\n" \
       "1 - play        \n" \
       "2 - high scores \n" \
       "0 - exit        \n" \
       "\n"
end
tries_left(tries_left) click to toggle source
# File lib/ep-codebreaker/messages.rb, line 49
def tries_left(tries_left)
  puts "#{tries_left} tries left.", "\n"
end
welcome() click to toggle source
# File lib/ep-codebreaker/messages.rb, line 21
def welcome
  puts 'Welcome to the Codebreaker game! Please choose one of the next options:'
end
win(answer) click to toggle source
# File lib/ep-codebreaker/messages.rb, line 41
def win(answer)
  puts 'Congratulations! You are the winner!', "It was #{answer}.", "\n"
end
wrong_option() click to toggle source
# File lib/ep-codebreaker/messages.rb, line 66
def wrong_option
  puts 'Wrong option!'
end