Module: CodeBreakerGemHoltobinAnton::View
- Included in:
- Game
- Defined in:
- lib/code_breaker_gem_holtobin_anton.rb
Instance Method Summary collapse
- #attempts_ended ⇒ Object
- #end_game_mess(str) ⇒ Object
- #hint_mess(num) ⇒ Object
- #print_marking ⇒ Object
- #restart_game_mess? ⇒ Boolean
- #start_mess ⇒ Object
Instance Method Details
#attempts_ended ⇒ Object
71 72 73 |
# File 'lib/code_breaker_gem_holtobin_anton.rb', line 71 def attempts_ended puts 'You have no more moves!' end |
#end_game_mess(str) ⇒ Object
58 59 60 61 62 63 64 |
# File 'lib/code_breaker_gem_holtobin_anton.rb', line 58 def end_game_mess(str) puts "You #{str}!" puts "Secret code = #{@secret_code}" if str == 'lost' puts 'Enter your name :' name = gets.chomp.capitalize "#{name} choice did #{@choice_did} out of #{@choice_size}.Hint used = #{@hint_used} #{str} \n" end |
#hint_mess(num) ⇒ Object
54 55 56 |
# File 'lib/code_breaker_gem_holtobin_anton.rb', line 54 def hint_mess(num) puts "Your tip is #{num}" end |
#print_marking ⇒ Object
75 76 77 |
# File 'lib/code_breaker_gem_holtobin_anton.rb', line 75 def print_marking puts @result end |
#restart_game_mess? ⇒ Boolean
66 67 68 69 |
# File 'lib/code_breaker_gem_holtobin_anton.rb', line 66 def restart_game_mess? puts 'Do you want to start the game again? (Yes/No)' gets.chomp.capitalize == 'Yes'? true : false end |
#start_mess ⇒ Object
48 49 50 51 52 |
# File 'lib/code_breaker_gem_holtobin_anton.rb', line 48 def start_mess puts 'Hello, let is start playing' puts 'You can enter a "hint" to display a random number' puts 'You can enter a "exit" to exit the game' end |