Class: Player
- Inherits:
-
Object
- Object
- Player
- Defined in:
- lib/tic-tac-toe/player.rb
Instance Method Summary collapse
-
#initialize(marker) ⇒ Player
constructor
A new instance of Player.
- #make_move(board, location) ⇒ Object
Constructor Details
#initialize(marker) ⇒ Player
Returns a new instance of Player.
2 3 4 |
# File 'lib/tic-tac-toe/player.rb', line 2 def initialize(marker) @marker = marker end |
Instance Method Details
#make_move(board, location) ⇒ Object
6 7 8 |
# File 'lib/tic-tac-toe/player.rb', line 6 def make_move(board, location) board.place_marker(@marker, location.to_i - 1) end |