Class: MaximizingPlayer
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_beta(beta, score) ⇒ Object
-
#initialize(player) ⇒ MaximizingPlayer
constructor
A new instance of MaximizingPlayer.
- #return_best_score(alpha, beta) ⇒ Object
Methods inherited from Player
Constructor Details
#initialize(player) ⇒ MaximizingPlayer
Returns a new instance of MaximizingPlayer.
60 61 62 63 |
# File 'lib/player.rb', line 60 def initialize(player) @marker = player.marker @opponent = player.opponent end |
Instance Attribute Details
#marker ⇒ Object
Returns the value of attribute marker.
59 60 61 |
# File 'lib/player.rb', line 59 def marker @marker end |
#opponent ⇒ Object
Returns the value of attribute opponent.
59 60 61 |
# File 'lib/player.rb', line 59 def opponent @opponent end |
Instance Method Details
#get_beta(beta, score) ⇒ Object
65 66 67 |
# File 'lib/player.rb', line 65 def get_beta(beta, score) score < beta ? score : beta end |
#return_best_score(alpha, beta) ⇒ Object
69 70 71 |
# File 'lib/player.rb', line 69 def return_best_score(alpha, beta) beta end |