Class: Maximizing

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_alpha, #next_player_turn

Constructor Details

#initialize(player) ⇒ Maximizing



49
50
51
52
53
# File 'lib/player.rb', line 49

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

Instance Attribute Details

#markerObject

Returns the value of attribute marker.



48
49
50
# File 'lib/player.rb', line 48

def marker
  @marker
end

#opponentObject

Returns the value of attribute opponent.



48
49
50
# File 'lib/player.rb', line 48

def opponent
  @opponent
end

#turnObject

Returns the value of attribute turn.



48
49
50
# File 'lib/player.rb', line 48

def turn
  @turn
end

Instance Method Details

#get_beta(beta, score) ⇒ Object



55
56
57
# File 'lib/player.rb', line 55

def get_beta(beta, score)
  score < beta ? score : beta
end

#return_value(alpha, beta) ⇒ Object



59
60
61
# File 'lib/player.rb', line 59

def return_value(alpha, beta)
  beta
end