Class: RubyTictactoe::AlphaBetaPlayer

Inherits:
Object
  • Object
show all
Defined in:
lib/ai.rb

Direct Known Subclasses

MaximizingPlayer, MinimizingPlayer

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#markerObject

Returns the value of attribute marker.



73
74
75
# File 'lib/ai.rb', line 73

def marker
  @marker
end

#opponentObject

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