Class: MastermindRuby::Game
- Inherits:
-
Object
- Object
- MastermindRuby::Game
- Defined in:
- lib/mastermind_ruby/game.rb
Instance Attribute Summary collapse
-
#try_count ⇒ Object
readonly
Returns the value of attribute try_count.
Instance Method Summary collapse
-
#initialize(ui, solution: Code.random) ⇒ Game
constructor
A new instance of Game.
-
#start ⇒ Object
Method to start a game Requests by calling read_playername for the playername on the UI.
Constructor Details
Instance Attribute Details
#try_count ⇒ Object (readonly)
Returns the value of attribute try_count.
3 4 5 |
# File 'lib/mastermind_ruby/game.rb', line 3 def try_count @try_count end |
Instance Method Details
#start ⇒ Object
Method to start a game Requests by calling read_playername for the playername on the UI
14 15 16 17 18 19 |
# File 'lib/mastermind_ruby/game.rb', line 14 def start @started = true @playername = @ui.read_playername @ui.(@playername) run end |