Class: Codebreaker::ConsoleApp
- Inherits:
-
Object
- Object
- Codebreaker::ConsoleApp
- Defined in:
- lib/ep-codebreaker/console_app.rb
Instance Method Summary collapse
-
#initialize ⇒ ConsoleApp
constructor
A new instance of ConsoleApp.
- #run ⇒ Object
Constructor Details
#initialize ⇒ ConsoleApp
Returns a new instance of ConsoleApp.
7 8 9 |
# File 'lib/ep-codebreaker/console_app.rb', line 7 def initialize @game = Game.new end |
Instance Method Details
#run ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/ep-codebreaker/console_app.rb', line 11 def run Messages.logo Messages.welcome loop do Messages.run print '> ' case gets.chomp when '1' then play when '2' then puts high_scores when '0' Messages.bye break else Messages.wrong_option end end end |