Class: RubyTictactoe::AIPlayer

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

Instance Attribute Summary

Attributes inherited from Player

#marker, #opponent

Instance Method Summary collapse

Methods inherited from Player

#add_marker, #initialize

Constructor Details

This class inherits a constructor from RubyTictactoe::Player

Instance Method Details

#make_move(board) ⇒ Object



5
6
7
8
9
# File 'lib/ai_player.rb', line 5

def make_move(board)
  ai = AI.new(self)
  cell = ai.computer_move(board, self)
  add_marker(board, cell)
end