Module: Codebreaker::Messages

Defined in:
lib/ep-codebreaker/messages.rb

Class Method Summary collapse

Class Method Details

.byeObject



62
63
64
# File 'lib/ep-codebreaker/messages.rb', line 62

def bye
  puts 'Good luck!'
end

.hint(hint, hints_left, tries_left) ⇒ Object



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

.logoObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/ep-codebreaker/messages.rb', line 6

def 
  puts " ]]]]    ]]]]   ]]]]]   ]]]]] \n" \
       "]]  ]]  ]]  ]]  ]]  ]]  ]]    \n" \
       "]]      ]]  ]]  ]]  ]]  ]]]]  \n" \
       "]]  ]]  ]]  ]]  ]]  ]]  ]]    \n" \
       " ]]]]    ]]]]   ]]]]]   ]]]]] \n" \
       "\n" \
       "]]]]]   ]]]]]   ]]]]]    ]]]]   ]]  ]]  ]]]]]   ]]]]]  \n" \
       "]]  ]]  ]]  ]]  ]]      ]]  ]]  ]] ]]   ]]      ]]  ]] \n" \
       "]]]]]   ]]]]]   ]]]]    ]]]]]]  ]]]]    ]]]]    ]]]]]  \n" \
       "]]  ]]  ]]  ]]  ]]      ]]  ]]  ]] ]]   ]]      ]]  ]] \n" \
       "]]]]]   ]]  ]]  ]]]]]   ]]  ]]  ]]  ]]  ]]]]]   ]]  ]] \n" \
       "\n"
end

.lose(answer) ⇒ Object



45
46
47
# File 'lib/ep-codebreaker/messages.rb', line 45

def lose(answer)
  puts 'Sorry, you lose(((', "It was #{answer}.", "\n"
end

.playObject



33
34
35
36
37
38
39
# File 'lib/ep-codebreaker/messages.rb', line 33

def play
  puts "Let's go! \n" \
       "\n" \
       "1 - hint  \n" \
       "0 - end   \n" \
       "\n"
end

.runObject



25
26
27
28
29
30
31
# 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) ⇒ Object



49
50
51
# File 'lib/ep-codebreaker/messages.rb', line 49

def tries_left(tries_left)
  puts "#{tries_left} tries left.", "\n"
end

.welcomeObject



21
22
23
# 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) ⇒ Object



41
42
43
# File 'lib/ep-codebreaker/messages.rb', line 41

def win(answer)
  puts 'Congratulations! You are the winner!', "It was #{answer}.", "\n"
end

.wrong_optionObject



66
67
68
# File 'lib/ep-codebreaker/messages.rb', line 66

def wrong_option
  puts 'Wrong option!'
end