Class: RockPaperScissors::Game
- Inherits:
-
Object
- Object
- RockPaperScissors::Game
- Defined in:
- lib/rock_paper_scissors/game_manager.rb
Instance Method Summary collapse
-
#initialize ⇒ Game
constructor
A new instance of Game.
- #play ⇒ Object
Constructor Details
#initialize ⇒ Game
Returns a new instance of Game.
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/rock_paper_scissors/game_manager.rb', line 6 def initialize # Instantiate board based on game mode mode = select_mode @board = Board.new(mode) num_players = select_player_mode initialize_players(num_players) puts "\n(Remember to begin play by entering game.play)" end |
Instance Method Details
#play ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/rock_paper_scissors/game_manager.rb', line 19 def play loop do @player1.select_move @player2.select_move break if winner end play unless quit? end |