Class: RubyTictactoe::AlphaBetaPlayer
- Inherits:
-
Object
- Object
- RubyTictactoe::AlphaBetaPlayer
- Defined in:
- lib/alpha_beta_player.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.
5 6 7 8 |
# File 'lib/alpha_beta_player.rb', line 5 def initialize(player) @marker = player.marker @opponent = player.opponent end |
Instance Attribute Details
#marker ⇒ Object
Returns the value of attribute marker.
4 5 6 |
# File 'lib/alpha_beta_player.rb', line 4 def marker @marker end |
#opponent ⇒ Object
Returns the value of attribute opponent.
4 5 6 |
# File 'lib/alpha_beta_player.rb', line 4 def opponent @opponent end |
Instance Method Details
#get_alpha(alpha, score) ⇒ Object
10 11 12 |
# File 'lib/alpha_beta_player.rb', line 10 def get_alpha(alpha, score) alpha end |
#get_beta(beta, score) ⇒ Object
14 15 16 |
# File 'lib/alpha_beta_player.rb', line 14 def get_beta(beta, score) beta end |