Module: Codebreaker::Phrases

Included in:
Console, Wellcome
Defined in:
lib/modules/phrases.rb

Instance Method Summary collapse

Instance Method Details

#about_complexitiesObject



14
15
16
17
18
19
20
21
22
# File 'lib/modules/phrases.rb', line 14

def about_complexities
  puts "    I have 3 levels of complexity\n    easy: hints 2, attempts 15\n    medium: hints 1, attempts 10\n    hard: hints 1, attempts 5\n    for choose complexity write: \"easy\", \"medium\" or \"hard\"\n  HEREDOC\nend\n"

#about_nameObject



24
25
26
27
28
29
30
# File 'lib/modules/phrases.rb', line 24

def about_name
  puts "    Remember!\n    your name must be from 3 to 25 letter\n    write your name:\n  HEREDOC\nend\n"

#empty_statisticObject



91
92
93
# File 'lib/modules/phrases.rb', line 91

def empty_statistic
  puts 'statistic is empty'
end

#error_massage(validator) ⇒ Object



51
52
53
54
55
56
57
58
59
60
61
62
# 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

#goodbyeObject



46
47
48
49
# File 'lib/modules/phrases.rb', line 46

def goodbye
  puts '<------------goodbye------------>'
  exit
end

#greetingObject



4
5
6
7
8
9
10
11
12
# File 'lib/modules/phrases.rb', line 4

def greeting
  puts "    Hello it`s a codebreaker\n    for start Core write: \"start\"\n    for show statistics write: \"stat\"\n    for show rules write: \"rules\"\n    in any moments you can exit just write: \"exit\"\n  HEREDOC\nend\n"

#phrase_before_guessObject



64
65
66
67
68
69
# File 'lib/modules/phrases.rb', line 64

def phrase_before_guess
  puts "    numbers is ready\n    try to guess or take a hint;)\n  HEREDOC\nend\n"

#phrase_loseObject



79
80
81
# File 'lib/modules/phrases.rb', line 79

def phrase_lose
  puts 'you lose :('
end

#phrase_winObject



87
88
89
# File 'lib/modules/phrases.rb', line 87

def phrase_win
  puts '<----------------YOU---WIN---------------->'
end

#puts_hint(hint) ⇒ Object



71
72
73
# File 'lib/modules/phrases.rb', line 71

def puts_hint(hint)
  puts "hint: #{hint}"
end

#rulesObject



32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/modules/phrases.rb', line 32

def rules
  puts "    the game sets a task\n    and this is a four-digit number\n    the goal is to guess this number\n    the game consists of 3 levels of difficulty easy, medium, hard\n    if you guess digit position in number the game would give you \"+\"\n    if you guess the presence of numbers in the number the game would give you \"-\"\n    also you can take a hint which would show a random number\n    the game will end when you guess the number or your hints will end\n    good luck and have fun\n  HEREDOC\nend\n"

#show(obj) ⇒ Object



83
84
85
# File 'lib/modules/phrases.rb', line 83

def show(obj)
  puts obj
end

#zero_hintObject



75
76
77
# File 'lib/modules/phrases.rb', line 75

def zero_hint
  puts 'sorry but tips are over :('
end