Class: RubyTictactoe::AlphaBetaPlayer
- Inherits:
-
Object
- Object
- RubyTictactoe::AlphaBetaPlayer
- Defined in:
- lib/ai.rb
Direct Known Subclasses
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
- #get_beta(beta, score) ⇒ Object
-
#initialize(player) ⇒ AlphaBetaPlayer
constructor
A new instance of AlphaBetaPlayer.
Constructor Details
#initialize(player) ⇒ AlphaBetaPlayer
Returns a new instance of AlphaBetaPlayer.
74 75 76 77 |
# File 'lib/ai.rb', line 74 def initialize(player) @marker = player.marker @opponent = player.opponent end |
Instance Attribute Details
#marker ⇒ Object
Returns the value of attribute marker.
73 74 75 |
# File 'lib/ai.rb', line 73 def marker @marker end |
#opponent ⇒ Object
Returns the value of attribute opponent.
73 74 75 |
# File 'lib/ai.rb', line 73 def opponent @opponent end |
Instance Method Details
#get_alpha(alpha, score) ⇒ Object
79 80 81 |
# File 'lib/ai.rb', line 79 def get_alpha(alpha, score) alpha end |
#get_beta(beta, score) ⇒ Object
83 84 85 |
# File 'lib/ai.rb', line 83 def get_beta(beta, score) beta end |