Class: Codebreaker::UserInterface

Inherits:
Object
  • Object
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



8
9
10
11
# File 'lib/codebreaker/user_interface.rb', line 8

def main_menu
  greeting_message
  gets.chomp == 'exit' ? bye : play
end

#playObject



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
  after_game_menu
end