Class: Player

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(marker) ⇒ Player

Returns a new instance of Player.



3
4
5
6
# File 'lib/player.rb', line 3

def initialize(marker)
  @marker = marker
  @opponent = nil
end

Instance Attribute Details

#markerObject

Returns the value of attribute marker.



2
3
4
# File 'lib/player.rb', line 2

def marker
  @marker
end

#opponentObject

Returns the value of attribute opponent.



2
3
4
# File 'lib/player.rb', line 2

def opponent
  @opponent
end

Instance Method Details

#add_marker(board, cell) ⇒ Object



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

def add_marker(board, cell)
  board.all_cells[cell] = self.marker
end

#get_alpha(alpha, score) ⇒ Object



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

def get_alpha(alpha, score)
  alpha
end

#get_beta(beta, score) ⇒ Object



16
17
18
# File 'lib/player.rb', line 16

def get_beta(beta, score)
  beta
end