Class: Connect::Player

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePlayer

Returns a new instance of Player.



7
8
9
# File 'lib/connect/player.rb', line 7

def initialize
    @piece = 'X'
end

Instance Attribute Details

#pieceObject (readonly)

Returns the value of attribute piece.



5
6
7
# File 'lib/connect/player.rb', line 5

def piece
  @piece
end

Instance Method Details

#make_move(column, board) ⇒ Object



11
12
13
# File 'lib/connect/player.rb', line 11

def make_move(column, board)
    board.add_piece(column, @piece)
end