Module: UiHelper
- Included in:
- Codebreaker::UserInterface
- Defined in:
- lib/codebreaker/user_interface_helper.rb
Instance Method Summary collapse
- #after_game_message ⇒ Object
- #greeting_message ⇒ Object
- #incorrect_format_message ⇒ Object
- #lost_message ⇒ Object
- #no_hints_message ⇒ Object
- #saved_result_message ⇒ Object
- #start_game_message ⇒ Object
- #used_attempts_message ⇒ Object
- #won_message ⇒ Object
Instance Method Details
#after_game_message ⇒ Object
34 35 36 |
# File 'lib/codebreaker/user_interface_helper.rb', line 34 def puts 'Do you want to play again(y/n) or save score(s)?' end |
#greeting_message ⇒ Object
4 5 6 7 |
# File 'lib/codebreaker/user_interface_helper.rb', line 4 def puts '***Welcome to the Codebreaker game!***' puts "Enter any characters to start playing or 'exit' for exit" end |
#incorrect_format_message ⇒ Object
22 23 24 |
# File 'lib/codebreaker/user_interface_helper.rb', line 22 def puts 'Incoorect format! Please enter 4 digits from 1 to 6' end |
#lost_message ⇒ Object
30 31 32 |
# File 'lib/codebreaker/user_interface_helper.rb', line 30 def puts 'You used all of attempts. You lost :(' end |
#no_hints_message ⇒ Object
18 19 20 |
# File 'lib/codebreaker/user_interface_helper.rb', line 18 def puts 'You used all of hints!' end |
#saved_result_message ⇒ Object
38 39 40 |
# File 'lib/codebreaker/user_interface_helper.rb', line 38 def puts 'Your result has been saved' end |
#start_game_message ⇒ Object
9 10 11 12 |
# File 'lib/codebreaker/user_interface_helper.rb', line 9 def puts "Please, enter your code to make guess or 'h' to get a hint" puts "You have #{Codebreaker::Game::ATTEMPTS} attempts and #{Codebreaker::Game::HINTS} hints" end |
#used_attempts_message ⇒ Object
14 15 16 |
# File 'lib/codebreaker/user_interface_helper.rb', line 14 def puts "You used #{@game.used_attempts} attempts." if @game.used_attempts > 0 end |
#won_message ⇒ Object
26 27 28 |
# File 'lib/codebreaker/user_interface_helper.rb', line 26 def puts '***Congratulations, you won!***' end |