Class: Mastermind::Game
- Inherits:
-
Object
- Object
- Mastermind::Game
- Defined in:
- lib/mastermind.rb
Instance Method Summary collapse
-
#initialize(game_text, terminal) ⇒ Game
constructor
A new instance of Game.
- #play_game ⇒ Object
Constructor Details
#initialize(game_text, terminal) ⇒ Game
Returns a new instance of Game.
8 9 10 11 12 |
# File 'lib/mastermind.rb', line 8 def initialize(game_text, terminal) @game_text = game_text @terminal = terminal @code_length = 4 end |
Instance Method Details
#play_game ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/mastermind.rb', line 14 def play_game @terminal.display(@game_text.(:welcome)) colors = get_color_scheme code = get_input(colors) set_up_board(code, colors) result = run_ai_player(colors) end_of_game(result) end |