Class: RubyTictactoe::AlphaBetaPlayer

Inherits:
Object
  • Object
show all
Defined in:
lib/alpha_beta_player.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.



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

#markerObject

Returns the value of attribute marker.



4
5
6
# File 'lib/alpha_beta_player.rb', line 4

def marker
  @marker
end

#opponentObject

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