module Codebreaker::Phrases

Public Instance Methods

about_complexities() click to toggle source
# File lib/modules/phrases.rb, line 14
    def about_complexities
      puts <<~HEREDOC
        I have 3 levels of complexity
        easy: hints 2, attempts 15
        medium: hints 1, attempts 10
        hard: hints 1, attempts 5
        for choose complexity write: "easy", "medium" or "hard"
      HEREDOC
    end
about_name() click to toggle source
# File lib/modules/phrases.rb, line 24
    def about_name
      puts <<~HEREDOC
        Remember!
        your name must be from 3 to 25 letter
        write your name:
      HEREDOC
    end
empty_statistic() click to toggle source
# File lib/modules/phrases.rb, line 91
def empty_statistic
  puts 'statistic is empty'
end
error_massage(validator) click to toggle source
# File lib/modules/phrases.rb, line 51
def error_massage(validator)
  case validator
  when 'navigation'
    puts 'please write "start", "stat" or "rules"'
  when 'name'
    puts 'valid name must have 3-25 letters'
  when 'guess'
    puts 'valid guess must have 4 nunbers and you can take hint'
  when 'complexity'
    puts 'you have 3 level "easy", "medium", "hard"'
  end
end
goodbye() click to toggle source
# File lib/modules/phrases.rb, line 46
def goodbye
  puts '<------------goodbye------------>'
  exit
end
greeting() click to toggle source
# File lib/modules/phrases.rb, line 4
    def greeting
      puts <<~HEREDOC
        Hello it`s a codebreaker
        for start Core write: "start"
        for show statistics write: "stat"
        for show rules write: "rules"
        in any moments you can exit just write: "exit"
      HEREDOC
    end
phrase_before_guess() click to toggle source
# File lib/modules/phrases.rb, line 64
    def phrase_before_guess
      puts <<~HEREDOC
        numbers is ready
        try to guess or take a hint;)
      HEREDOC
    end
phrase_lose() click to toggle source
# File lib/modules/phrases.rb, line 79
def phrase_lose
  puts 'you lose :('
end
phrase_win() click to toggle source
# File lib/modules/phrases.rb, line 87
def phrase_win
  puts '<----------------YOU---WIN---------------->'
end
puts_hint(hint) click to toggle source
# File lib/modules/phrases.rb, line 71
def puts_hint(hint)
  puts "hint: #{hint}"
end
rules() click to toggle source
# File lib/modules/phrases.rb, line 32
    def rules
      puts <<~HEREDOC
        the game sets a task
        and this is a four-digit number
        the goal is to guess this number
        the game consists of 3 levels of difficulty easy, medium, hard
        if you guess digit position in number the game would give you "+"
        if you guess the presence of numbers in the number the game would give you "-"
        also you can take a hint which would show a random number
        the game will end when you guess the number or your hints will end
        good luck and have fun
      HEREDOC
    end
show(obj) click to toggle source
# File lib/modules/phrases.rb, line 83
def show(obj)
  puts obj
end
zero_hint() click to toggle source
# File lib/modules/phrases.rb, line 75
def zero_hint
  puts 'sorry but tips are over :('
end