Class: MinimizingPlayer
Instance Attribute Summary collapse
-
#marker ⇒ Object
Returns the value of attribute marker.
-
#opponent ⇒ Object
Returns the value of attribute opponent.
Instance Method Summary collapse
- #get_alpha(alpha, score) ⇒ Object
-
#initialize(player) ⇒ MinimizingPlayer
constructor
A new instance of MinimizingPlayer.
- #return_best_score(alpha, beta) ⇒ Object
Methods inherited from Player
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
#marker ⇒ Object
Returns the value of attribute marker.
43 44 45 |
# File 'lib/player.rb', line 43 def marker @marker end |
#opponent ⇒ Object
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 |