Class: Game

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

Direct Known Subclasses

NoughtsAndCrosses, PickANumber

Instance Method Summary collapse

Constructor Details

#initializeGame

Returns a new instance of Game.



3
4
# File 'lib/game.rb', line 3

def initialize
end

Instance Method Details

#display(message) ⇒ Object



6
7
8
9
10
# File 'lib/game.rb', line 6

def display message
  unless @quiet
    p message
  end
end

#reload_position(moves) ⇒ Object



12
13
14
15
16
# File 'lib/game.rb', line 12

def reload_position moves
  moves.each do |player, move|
    self.play_move player, move
  end
end