Class: Codebreaker::UserInterface
- Inherits:
-
Object
- Object
- Codebreaker::UserInterface
show all
- Includes:
- UiHelper
- Defined in:
- lib/codebreaker/user_interface.rb
Instance Method Summary
collapse
Methods included from UiHelper
#after_game_message, #greeting_message, #incorrect_format_message, #lost_message, #no_hints_message, #saved_result_message, #start_game_message, #used_attempts_message, #won_message
Instance Method Details
#main_menu ⇒ Object
8
9
10
11
|
# File 'lib/codebreaker/user_interface.rb', line 8
def main_menu
greeting_message
gets.chomp == 'exit' ? bye : play
end
|
#play ⇒ Object
13
14
15
16
17
18
19
20
|
# File 'lib/codebreaker/user_interface.rb', line 13
def play
create_new_game
start_game_message
playing
lost unless attempts?
score
end
|