Class: MinimizingPlayer

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Player

#add_marker, #get_beta

Constructor Details

#initialize(player) ⇒ MinimizingPlayer

Returns a new instance of MinimizingPlayer.



44
45
46
47
# File 'lib/player.rb', line 44

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

Instance Attribute Details

#markerObject

Returns the value of attribute marker.



43
44
45
# File 'lib/player.rb', line 43

def marker
  @marker
end

#opponentObject

Returns the value of attribute opponent.



43
44
45
# File 'lib/player.rb', line 43

def opponent
  @opponent
end

Instance Method Details

#get_alpha(alpha, score) ⇒ Object



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

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

#return_best_score(alpha, beta) ⇒ Object



53
54
55
# File 'lib/player.rb', line 53

def return_best_score(alpha, beta)
  alpha
end