Class: Codebreaker::GameConsole

Inherits:
Object
  • Object
show all
Defined in:
lib/console.rb

Instance Method Summary collapse

Constructor Details

#initializeGameConsole

Returns a new instance of GameConsole.



5
6
7
# File 'lib/console.rb', line 5

def initialize
  @game = Game.new
end

Instance Method Details

#playObject



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/console.rb', line 9

def play
  loop do
    choice = menu
    break if choice == '0'
    case choice
    when '1'
      play_game
      save
    when '2'
      show_table
    end
  end
end