class Tictactoe::Players::PerfectComputer

Attributes

player[RW]

Public Class Methods

new(mark, random = Random.new) click to toggle source
# File lib/tictactoe/players/perfect_computer.rb, line 8
def initialize(mark, random = Random.new)
  intelligence = Tictactoe::Ai::PerfectIntelligence.new
  chooser = Tictactoe::Ai::RandomChooser.new(random)
  self.player = Tictactoe::Players::Computer.new(mark, intelligence, chooser)
end

Public Instance Methods

get_move(state) click to toggle source
# File lib/tictactoe/players/perfect_computer.rb, line 14
def get_move(state)
  player.get_move(state)
end
mark() click to toggle source
# File lib/tictactoe/players/perfect_computer.rb, line 18
def mark
  player.mark
end
ready_to_move?() click to toggle source
# File lib/tictactoe/players/perfect_computer.rb, line 22
def ready_to_move?
  player.ready_to_move?
end