Class: TTT::Interface::CLI::ComputerPlayer

Inherits:
Player
  • Object
show all
Defined in:
lib/ttt/interface/cli/players.rb

Instance Attribute Summary collapse

Attributes inherited from Player

#cli, #game, #marker

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ ComputerPlayer

Returns a new instance of ComputerPlayer.



25
26
27
28
# File 'lib/ttt/interface/cli/players.rb', line 25

def initialize(*args)
  super
  self.computer = TTT::ComputerPlayer.new game
end

Instance Attribute Details

#computerObject

Returns the value of attribute computer.



24
25
26
# File 'lib/ttt/interface/cli/players.rb', line 24

def computer
  @computer
end

Instance Method Details

#take_turnObject



29
30
31
# File 'lib/ttt/interface/cli/players.rb', line 29

def take_turn
  computer.take_turn
end