Class: Minimizing
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_alpha(alpha, score) ⇒ Object
-
#initialize(player) ⇒ Minimizing
constructor
A new instance of Minimizing.
- #return_value(alpha, beta) ⇒ Object
Methods inherited from Player
#current_player?, #get_beta, #next_player_turn
Constructor Details
#initialize(player) ⇒ Minimizing
Returns a new instance of Minimizing.
30 31 32 33 34 |
# File 'lib/player.rb', line 30 def initialize(player) @marker = player.marker @turn = player.turn @opponent = player.opponent end |
Instance Attribute Details
#marker ⇒ Object
Returns the value of attribute marker.
29 30 31 |
# File 'lib/player.rb', line 29 def marker @marker end |
#opponent ⇒ Object
Returns the value of attribute opponent.
29 30 31 |
# File 'lib/player.rb', line 29 def opponent @opponent end |
#turn ⇒ Object
Returns the value of attribute turn.
29 30 31 |
# File 'lib/player.rb', line 29 def turn @turn end |
Instance Method Details
#get_alpha(alpha, score) ⇒ Object
36 37 38 |
# File 'lib/player.rb', line 36 def get_alpha(alpha, score) score > alpha ? score : alpha end |
#return_value(alpha, beta) ⇒ Object
40 41 42 |
# File 'lib/player.rb', line 40 def return_value(alpha, beta) alpha end |