Class: Player

Inherits:
Object
  • Object
show all
Defined in:
lib/tic-tac-toe/player.rb

Instance Method Summary collapse

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