Module: Codebreaker::Messages
- Defined in:
- lib/ep-codebreaker/messages.rb
Class Method Summary collapse
- .bye ⇒ Object
- .hint(hint, hints_left, tries_left) ⇒ Object
- .logo ⇒ Object
- .lose(answer) ⇒ Object
- .play ⇒ Object
- .run ⇒ Object
- .tries_left(tries_left) ⇒ Object
- .welcome ⇒ Object
- .win(answer) ⇒ Object
- .wrong_option ⇒ Object
Class Method Details
.bye ⇒ Object
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 |
.logo ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/ep-codebreaker/messages.rb', line 6 def logo 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 |
.play ⇒ Object
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 |
.run ⇒ Object
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 |
.welcome ⇒ Object
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_option ⇒ Object
66 67 68 |
# File 'lib/ep-codebreaker/messages.rb', line 66 def wrong_option puts 'Wrong option!' end |