Class: Maximizing
Instance Attribute Summary collapse
-
#marker ⇒ Object
Returns the value of attribute marker.
-
#opponent ⇒ Object
Returns the value of attribute opponent.
-
#turn ⇒ Object
Returns the value of attribute turn.
Attributes inherited from Player
Instance Method Summary collapse
- #get_beta(beta, score) ⇒ Object
-
#initialize(player) ⇒ Maximizing
constructor
A new instance of Maximizing.
- #return_value(alpha, beta) ⇒ Object
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
#marker ⇒ Object
Returns the value of attribute marker.
48 49 50 |
# File 'lib/player.rb', line 48 def marker @marker end |
#opponent ⇒ Object
Returns the value of attribute opponent.
48 49 50 |
# File 'lib/player.rb', line 48 def opponent @opponent end |
#turn ⇒ Object
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 |