Class: Minimizing

Inherits:
Player show all
Defined in:
lib/player.rb

Instance Attribute Summary collapse

Attributes inherited from Player

#player_type

Instance Method Summary collapse

Methods inherited from Player

#current_player?, #get_beta, #next_player_turn

Constructor Details

#initialize(player) ⇒ Minimizing

Returns a new instance of Minimizing.



30
31
32
33
34
# File 'lib/player.rb', line 30

def initialize(player)
  @marker      = player.marker
  @turn        = player.turn
  @opponent    = player.opponent
end

Instance Attribute Details

#markerObject

Returns the value of attribute marker.



29
30
31
# File 'lib/player.rb', line 29

def marker
  @marker
end

#opponentObject

Returns the value of attribute opponent.



29
30
31
# File 'lib/player.rb', line 29

def opponent
  @opponent
end

#turnObject

Returns the value of attribute turn.



29
30
31
# File 'lib/player.rb', line 29

def turn
  @turn
end

Instance Method Details

#get_alpha(alpha, score) ⇒ Object



36
37
38
# File 'lib/player.rb', line 36

def get_alpha(alpha, score)
  score > alpha ? score : alpha
end

#return_value(alpha, beta) ⇒ Object



40
41
42
# File 'lib/player.rb', line 40

def return_value(alpha, beta)
  alpha
end